﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model;
using BLL;
using System.Data;
using DBUtility;

namespace IYASAKAReport
{
    public class AJReport : VehicleBase 
    {
        public AJReport(RESULT_VEHICLE_INFO result_vehicle_info, bool bSingle)
            : base(result_vehicle_info, bSingle)
        {
            Vehicle_Info = result_vehicle_info;
            bShowAllJCLSH = false;
            bShowWKCCAndZBZL = false;
            bTestRG = GetIsTestRG();
        }

        /// <summary>
        /// 结果详细信息
        /// </summary>
        public RESULT_VEHICLE_INFO Vehicle_Info { get; private set; }

        /// <summary>
        /// 仪器统计不合格项目
        /// </summary>
        private Dictionary<string, string> dicYQFailItems = new Dictionary<string, string>();

        /// <summary>
        /// 安检仪器报告单的Remark,用于记录
        /// </summary>
        private string YQRemark { get; set; }

        /// <summary>
        /// 是否进行了人工检验
        /// </summary>
        public bool bTestRG { get; private set; }

        /// <summary>
        /// 是否显示外廓尺寸
        /// </summary>
        public bool bShowWKCCAndZBZL { get; set; }

        #region 报告单
        /// <summary>
        /// 得到基本信息Table
        /// </summary>
        /// <returns></returns>
        public DataTable GetDataTableReport_Base(DataTable dtBase)
        {
            DataRow drBase = dtBase.NewRow();
            drBase["AJLSH"] = Vehicle_Info.JCLSH.Split('-')[0];
            drBase["JCLSH"] = JCLSH;
            drBase["HPHM"] = Vehicle_Info.HPHM;
            drBase["CLZL"] = Vehicle_Info.CLZL;
            drBase["SYR"] = Vehicle_Info.SYR;
            drBase["CLZL"] = Vehicle_Info.CLZL;
            drBase["PP"] = Vehicle_Info.PP;
            drBase["XH"] = Vehicle_Info.XH;
            drBase["SYR"] = Vehicle_Info.SYR;
            drBase["SYXZ"] = Vehicle_Info.SYXZ;
            drBase["CCDJRQ"] = Convert.ToDateTime(Vehicle_Info.CCDJRQ).ToString("yyyy-MM-dd");
            drBase["CCRQ"] = Convert.ToDateTime(Vehicle_Info.CCRQ).ToString("yyyy-MM-dd");
            drBase["CLXXSJ"] = Convert.ToDateTime(Vehicle_Info.CLXXSJ).ToString("yyyy-MM-dd");
            drBase["JCZDZ"] = StationInfo.STATION_ADDRESS;
            drBase["JCZDH"] = StationInfo.STATION_TEL;
            drBase["VIN"] = Vehicle_Info.VIN;
            drBase["FDJH"] = Vehicle_Info.FDJH;
            drBase["JCZMC"] = StationInfo.STATION_NAME;
            drBase["DWMC"] = StationInfo.STATION_NAME;
            string[] strStartEnd = AJGetStartEndTime(Vehicle_Info);
            drBase["XCJYRQKS"] = strStartEnd[0];
            drBase["XCJYRQJS"] = strStartEnd[1];
            drBase["YJGJBZ"] = GetAJ_GB(Vehicle_Info);
            drBase["JY_Mess"] = "";
            drBase["JYJH"] = "";

            dtBase.Rows.Add(drBase);
            return dtBase;
        }

        /// <summary>
        /// 得到报告单的人工部分
        /// </summary>
        /// <param name="dtRG"></param>
        /// <returns></returns>
        public DataTable GetDataTableReport_RG(DataTable dtRG)
        {
            DataRow drRG = dtRG.NewRow();
            drRG["JCLSH"] = JCLSH;

            if (bTestRG)
            {
                RESULT_CHASISS_MANUAL_BLL manual_bll = new RESULT_CHASISS_MANUAL_BLL();
                foreach (var jclsh in lstJCLSH)
                {
                    var manual = manual_bll.GetModel(jclsh);
                    if (string.IsNullOrEmpty(manual.JCLSH) == false)
                    {
                        drRG["Item_1_PD"] = GetPDResult(manual.WYXRD_PD);
                        drRG["Item_2_PD"] = GetPDResult(manual.CLTZCSJC_PD);
                        drRG["Item_3_PD"] = GetPDResult(manual.WGJC_PD);
                        drRG["Item_4_PD"] = GetPDResult(manual.AQZZJY_PD);
                        drRG["Item_5_PD"] = GetPDResult(manual.LWCX_PD);
                        drRG["Item_6_PD"] = GetPDResult(manual.DTDP_PD);
                        drRG["Item_7_PD"] = GetPDResult(manual.DPBJ_PD);

                        if (GetPDResult(manual.WYXRD_PD) == Nothing)
                        {
                            drRG["Item_1_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_1_Mess"] = string.IsNullOrEmpty(manual.WYXRD_MS.Trim()) ? NothingC : manual.WYXRD_MS;
                        }

                        if (GetPDResult(manual.CLTZCSJC_PD) == Nothing)
                        {
                            drRG["Item_2_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_2_Mess"] = string.IsNullOrEmpty(manual.CLTZCSJC_MS.Trim()) ? NothingC : manual.CLTZCSJC_MS;
                        }

                        if (GetPDResult(manual.WGJC_PD) == Nothing)
                        {
                            drRG["Item_3_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_3_Mess"] = string.IsNullOrEmpty(manual.WGJC_MS.Trim()) ? NothingC : manual.WGJC_MS.Trim();
                        }

                        if (GetPDResult(manual.AQZZJY_PD) == Nothing)
                        {
                            drRG["Item_4_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_4_Mess"] = string.IsNullOrEmpty(manual.AQZZJY_MS.Trim()) ? NothingC : manual.AQZZJY_MS.Trim();
                        }

                        if (GetPDResult(manual.LWCX_PD) == Nothing)
                        {
                            drRG["Item_5_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_5_Mess"] = string.IsNullOrEmpty(manual.LWCX_MS.Trim()) ? NothingC : manual.LWCX_MS.Trim();
                        }

                        if (GetPDResult(manual.DTDP_PD) == Nothing)
                        {
                            drRG["Item_6_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_6_Mess"] = string.IsNullOrEmpty(manual.DTDP_MS.Trim()) ? NothingC : manual.DTDP_MS.Trim();
                        }

                        if (GetPDResult(manual.DPBJ_PD) == Nothing)
                        {
                            drRG["Item_7_Mess"] = Nothing;
                        }
                        else
                        {
                            drRG["Item_7_Mess"] = string.IsNullOrEmpty(manual.DPBJ_MS.Trim()) ? NothingC : manual.DPBJ_MS.Trim();
                        }
                    }
                }
            }
            else
            {
                drRG["Item_1_PD"] = Nothing;
                drRG["Item_2_PD"] = Nothing;
                drRG["Item_3_PD"] = Nothing;
                drRG["Item_4_PD"] = Nothing;
                drRG["Item_5_PD"] = Nothing;
                drRG["Item_6_PD"] = Nothing;
                drRG["Item_7_PD"] = Nothing;

                drRG["Item_1_Mess"] = Nothing;
                drRG["Item_2_Mess"] = Nothing;
                drRG["Item_3_Mess"] = Nothing;
                drRG["Item_4_Mess"] = Nothing;
                drRG["Item_5_Mess"] = Nothing;
                drRG["Item_6_Mess"] = Nothing;
                drRG["Item_7_Mess"] = Nothing;
            }

            dtRG.Rows.Add(drRG);
            return dtRG;
        }

        /// <summary>
        /// 得到报告单的仪器部分
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        public List<DataTable> GetDataTableReport_YQ(DataSet ds)
        {
            List<DataTable> lstDt = new List<DataTable>();

            #region 初始化Datatable
            DataTable dtYQ = ds.Tables["DtYQ"];
            DataTable dtYQ_Item = ds.Tables["DtYQ_Item"];

            DataRow drYQ = dtYQ.NewRow();
            DataRow drYQ_Item = dtYQ_Item.NewRow();

            drYQ["JCLSH"] = JCLSH;
            drYQ_Item["JCLSH"] = JCLSH;
            #endregion

            Dictionary<string, Tuple<string, string, string, string>> dicTestItems = new Dictionary<string, Tuple<string, string, string, string>>();

            for (int i = 1; i < 25; i++)
            {
                Tuple<string, string, string, string> tl = new Tuple<string, string, string, string>("", "", "", "");
                dicTestItems.Add("key" + i, tl);
            }

            #region 刹车部分
            RESULT_BRAKE_BLL brake_bll = new RESULT_BRAKE_BLL();
            Dictionary<string, string> dicBrake = new Dictionary<string, string>();
            //一轴空载
            dicBrake.Add("YZZDLV", Nothing);
            dicBrake.Add("YZBPHLV", Nothing);
            dicBrake.Add("YZZDLVBZ", Nothing);
            dicBrake.Add("YZBPHLVBZ", Nothing);
            dicBrake.Add("YZZDLV_PD", Nothing);
            dicBrake.Add("YZBPHLV_PD", Nothing);

            //一轴加载
            dicBrake.Add("YZJZZDLV", Nothing);
            dicBrake.Add("YZJZBPHLV", Nothing);
            dicBrake.Add("YZJZZDLVBZ", Nothing);
            dicBrake.Add("YZJZBPHLVBZ", Nothing);
            dicBrake.Add("YZJZZDLV_PD", Nothing);
            dicBrake.Add("YZJZBPHLV_PD", Nothing);

            //二轴空载
            dicBrake.Add("EZZDLV", Nothing);
            dicBrake.Add("EZBPHLV", Nothing);
            dicBrake.Add("EZZDLVBZ", Nothing);
            dicBrake.Add("EZBPHLVBZ", Nothing);
            dicBrake.Add("EZZDLV_PD", Nothing);
            dicBrake.Add("EZBPHLV_PD", Nothing);

            //二轴加载
            dicBrake.Add("EZJZZDLV", Nothing);
            dicBrake.Add("EZJZBPHLV", Nothing);
            dicBrake.Add("EZJZZDLVBZ", Nothing);
            dicBrake.Add("EZJZBPHLVBZ", Nothing);
            dicBrake.Add("EZJZZDLV_PD", Nothing);
            dicBrake.Add("EZJZBPHLV_PD", Nothing);

            //三轴空载
            dicBrake.Add("SZZDLV", Nothing);
            dicBrake.Add("SZBPHLV", Nothing);
            dicBrake.Add("SZZDLVBZ", Nothing);
            dicBrake.Add("SZBPHLVBZ", Nothing);
            dicBrake.Add("SZZDLV_PD", Nothing);
            dicBrake.Add("SZBPHLV_PD", Nothing);

            //三轴加载
            dicBrake.Add("SZJZZDLV", Nothing);
            dicBrake.Add("SZJZBPHLV", Nothing);
            dicBrake.Add("SZJZZDLVBZ", Nothing);
            dicBrake.Add("SZJZBPHLVBZ", Nothing);
            dicBrake.Add("SZJZZDLV_PD", Nothing);
            dicBrake.Add("SZJZBPHLV_PD", Nothing);

            //四轴空载
            dicBrake.Add("SIZZDLV", Nothing);
            dicBrake.Add("SIZBPHLV", Nothing);
            dicBrake.Add("SIZZDLVBZ", Nothing);
            dicBrake.Add("SIZBPHLVBZ", Nothing);
            dicBrake.Add("SIZZDLV_PD", Nothing);
            dicBrake.Add("SIZBPHLV_PD", Nothing);

            //五轴空载
            dicBrake.Add("WZZDLV", Nothing);
            dicBrake.Add("WZBPHLV", Nothing);
            dicBrake.Add("WZZDLVBZ", Nothing);
            dicBrake.Add("WZBPHLVBZ", Nothing);
            dicBrake.Add("WZZDZ_PD", Nothing);
            dicBrake.Add("WZBPHLV_PD", Nothing);

            //驻车和整车
            dicBrake.Add("ZCSZDLV", Nothing);
            dicBrake.Add("ZCZDLV", Nothing);
            dicBrake.Add("SZDLVBZ", Nothing);
            dicBrake.Add("ZCZDLVBZ", Nothing);
            dicBrake.Add("SZDLV_PD", Nothing);
            dicBrake.Add("ZCZDLV_PD", Nothing);

            //汽车列车不平衡率
            dicBrake.Add("QCLCZCBZ", Nothing);
            dicBrake.Add("QCLCZCZDLV", Nothing);
            dicBrake.Add("QCLCZC_PD", Nothing);

            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var brakeM = brake_bll.GetModel(lstJCLSH[i]);
                #region 一轴
                //一轴空载
                if (!string.IsNullOrEmpty((brakeM.YZZDLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.YZZDLV_PD) > 0)
                    {
                        dicBrake["YZZDLV"] = brakeM.YZZDLV.Trim();
                        dicBrake["YZZDLVBZ"] = brakeM.YZZDLVBZ.Trim();
                        dicBrake["YZZDLV_PD"] = GetPDResult(brakeM.YZZDLV_PD.Trim());
                    }
                }

                if (!string.IsNullOrEmpty((brakeM.YZBPHLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.YZBPHLV_PD) > 0)
                    {
                        dicBrake["YZBPHLV"] = brakeM.YZBPHLV.Trim();
                        dicBrake["YZBPHLVBZ"] = brakeM.YZBPHLVBZ.Trim();
                        dicBrake["YZBPHLV_PD"] = GetPDResult(brakeM.YZBPHLV_PD.Trim());
                    }
                }

                //一轴加载
                if (!string.IsNullOrEmpty((brakeM.YZJZZDLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.YZJZZDLV_PD) > 0)
                    {
                        dicBrake["YZJZZDLV"] = brakeM.YZJZZDLV.Trim();
                        dicBrake["YZJZZDLVBZ"] = brakeM.YZJZZDLVBZ.Trim();
                        dicBrake["YZJZZDLV_PD"] = GetPDResult(brakeM.YZJZZDLV_PD.Trim());
                    }
                }

                if (!string.IsNullOrEmpty((brakeM.YZJZBPHLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.YZJZBPHLV_PD) > 0)
                    {
                        dicBrake["YZJZBPHLV"] = brakeM.YZJZBPHLV.Trim();
                        dicBrake["YZJZBPHLVBZ"] = brakeM.YZBPHLVBZ.Trim();
                        dicBrake["YZJZBPHLV_PD"] = GetPDResult(brakeM.YZJZBPHLV_PD.Trim());
                    }
                }
                #endregion

                #region 二轴
                //二轴空载
                if (!string.IsNullOrEmpty((brakeM.EZZDLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.EZZDLV_PD) > 0)
                    {
                        dicBrake["EZZDLV"] = brakeM.EZZDLV.Trim();
                        dicBrake["EZZDLVBZ"] = brakeM.EZZDLVBZ.Trim();
                        dicBrake["EZZDLV_PD"] = GetPDResult(brakeM.EZZDLV_PD.Trim());
                    }
                }

                if (!string.IsNullOrEmpty((brakeM.EZBPHLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.EZBPHLV_PD) > 0)
                    {
                        dicBrake["EZBPHLV"] = brakeM.EZBPHLV.Trim();
                        dicBrake["EZBPHLVBZ"] = brakeM.EZBPHLVBZ.Trim();
                        dicBrake["EZBPHLV_PD"] = GetPDResult(brakeM.EZBPHLV_PD.Trim());
                    }
                }
                //二轴加载
                if (!string.IsNullOrEmpty((brakeM.EZJZZDLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.EZJZZDLV_PD) > 0)
                    {
                        dicBrake["EZJZZDLV"] = brakeM.EZJZZDLV.Trim();
                        dicBrake["EZJZZDLVBZ"] = brakeM.EZJZZDLVBZ.Trim();
                        dicBrake["EZJZZDLV_PD"] = GetPDResult(brakeM.EZJZZDLV_PD.Trim());
                    }
                }

                if (!string.IsNullOrEmpty((brakeM.EZJZBPHLV_PD)))
                {
                    if (Convert.ToInt32(brakeM.EZJZBPHLV_PD) > 0)
                    {
                        dicBrake["EZJZBPHLV"] = brakeM.EZJZBPHLV.Trim();
                        dicBrake["EZJZBPHLVBZ"] = brakeM.EZBPHLVBZ.Trim();
                        dicBrake["EZJZBPHLV_PD"] = GetPDResult(brakeM.EZJZBPHLV_PD.Trim());
                    }
                }
                #endregion

                #region 三轴
                if (ZZS > 2)
                {
                    //三轴空载
                    if (!string.IsNullOrEmpty((brakeM.SZZDLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.SZZDLV_PD) > 0)
                        {
                            dicBrake["SZZDLV"] = brakeM.SZZDLV.Trim();
                            dicBrake["SZZDLVBZ"] = brakeM.SZZDLVBZ.Trim();
                            dicBrake["SZZDLV_PD"] = GetPDResult(brakeM.SZZDLV_PD.Trim());
                        }
                    }

                    if (!string.IsNullOrEmpty((brakeM.SZBPHLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.SZBPHLV_PD) > 0)
                        {
                            dicBrake["SZBPHLV"] = brakeM.SZBPHLV.Trim();
                            dicBrake["SZBPHLVBZ"] = brakeM.SZBPHLVBZ.Trim();
                            dicBrake["SZBPHLV_PD"] = GetPDResult(brakeM.SZBPHLV_PD.Trim());
                        }
                    }

                    //三轴加载
                    if (!string.IsNullOrEmpty((brakeM.SZJZZDLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.SZJZZDLV_PD) > 0)
                        {
                            dicBrake["SZJZZDLV"] = brakeM.SZZDLVBZ.Trim();
                            dicBrake["SZJZZDLVBZ"] = brakeM.SZJZZDLVBZ.Trim();
                            dicBrake["SZJZZDLV_PD"] = GetPDResult(brakeM.SZJZZDLV_PD.Trim());
                        }
                    }

                    if (!string.IsNullOrEmpty((brakeM.SZJZBPHLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.SZJZBPHLV_PD) > 0)
                        {
                            dicBrake["SZJZBPHLV"] = brakeM.SZBPHLV.Trim();
                            dicBrake["SZJZBPHLVBZ"] = brakeM.SZBPHLVBZ.Trim();
                            dicBrake["SZJZBPHLV_PD"] = GetPDResult(brakeM.SZJZBPHLV_PD.Trim());
                        }
                    }
                }
                #endregion

                #region 四轴
                if (ZZS > 3)
                {
                    //四轴空载
                    if (!string.IsNullOrEmpty((brakeM.SIZZDLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.SIZZDLV_PD) > 0)
                        {
                            dicBrake["SIZZDLV"] = brakeM.SIZZDLV.Trim();
                            dicBrake["SIZZDLVBZ"] = brakeM.SIZZDLVBZ.Trim();
                            dicBrake["SIZZDLV_PD"] = GetPDResult(brakeM.SIZZDLV_PD.Trim());
                        }
                    }

                    if (!string.IsNullOrEmpty((brakeM.SIZBPHLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.SIZBPHLV_PD) > 0)
                        {
                            dicBrake["SIZBPHLV"] = brakeM.SZBPHLV.Trim();
                            dicBrake["SIZBPHLVBZ"] = brakeM.SZBPHLVBZ.Trim();
                            dicBrake["SIZBPHLV_PD"] = GetPDResult(brakeM.SIZBPHLV_PD.Trim());
                        }
                    }
                }
                #endregion

                #region 五轴
                if (ZZS > 4)
                {
                    if (!string.IsNullOrEmpty((brakeM.WZZDZ_PD)))
                    {
                        if (Convert.ToInt32(brakeM.WZZDZ_PD) > 0)
                        {
                            dicBrake["WZZDLV"] = brakeM.SZZDLVBZ.Trim();
                            dicBrake["WZZDLVBZ"] = brakeM.SZZDLVBZ.Trim();
                            dicBrake["WZZDZ_PD"] = GetPDResult(brakeM.WZZDZ_PD.Trim());
                        }
                    }

                    if (!string.IsNullOrEmpty((brakeM.WZBPHLV_PD)))
                    {
                        if (Convert.ToInt32(brakeM.WZBPHLV_PD) > 0)
                        {
                            dicBrake["WZBPHLV"] = brakeM.SZBPHLV.Trim();
                            dicBrake["WZBPHLVBZ"] = brakeM.SZBPHLVBZ.Trim();
                            dicBrake["WZBPHLV_PD"] = GetPDResult(brakeM.WZBPHLV_PD.Trim());
                        }
                    }
                }
                #endregion

                #region 驻车和整车
                if (!string.IsNullOrEmpty(brakeM.SZDLV_PD))
                {
                    if (Convert.ToInt32(brakeM.SZDLV_PD) > 0)
                    {
                        dicBrake["ZCSZDLV"] = brakeM.ZCSZDLV.Trim();
                        dicBrake["SZDLVBZ"] = brakeM.SZDLVBZ.Trim();
                        dicBrake["SZDLV_PD"] = GetPDResult(brakeM.SZDLV_PD.Trim());
                    }
                }

                if (!string.IsNullOrEmpty(brakeM.ZCZDLV_PD))
                {
                    if (Convert.ToInt32(brakeM.ZCZDLV_PD) > 0)
                    {
                        dicBrake["ZCZDLV"] = brakeM.ZCZDLV.Trim();
                        dicBrake["ZCZDLVBZ"] = brakeM.ZCZDLVBZ.Trim();
                        dicBrake["ZCZDLV_PD"] = GetPDResult(brakeM.ZCZDLV_PD.Trim());
                    }
                }
                #endregion

                if (!string.IsNullOrEmpty(brakeM.QCLCZC_PD) && Convert.ToInt32(brakeM.QCLCZC_PD)>0)
                {
                    dicBrake["QCLCZCBZ"] = brakeM.QCLCZCBZ.Trim();
                    dicBrake["QCLCZCZDLV"] = brakeM.QCLCZCZDLV.Trim();
                    dicBrake["QCLCZC_PD"] = GetPDResult(brakeM.QCLCZC_PD);
                }
            }
            //一轴空载
            if (dicBrake["YZZDLV"] != Nothing || dicBrake["YZBPHLV"] != Nothing)
            {
                dicTestItems["key1"] = new Tuple<string, string, string, string>("一轴空载制动率/不平衡率(%)",
                    dicBrake["YZZDLV"] + " / " + dicBrake["YZBPHLV"],
                    (dicBrake["YZZDLVBZ"] != Nothing ? MoreThan + dicBrake["YZZDLVBZ"] : dicBrake["YZZDLVBZ"]) + " / " + (dicBrake["YZBPHLVBZ"] != Nothing ? LessThan + dicBrake["YZBPHLVBZ"] : dicBrake["YZBPHLVBZ"]),
                    dicBrake["YZZDLV_PD"] + " / " + dicBrake["YZBPHLV_PD"]);

                if (dicBrake["YZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YZZDLV_PD"))
                    {
                        dicYQFailItems.Add("YZZDLV_PD", "一轴空载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("YZZDLV_PD");
                    }
                }

                if (dicBrake["YZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("YZBPHLV_PD", "一轴空载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("YZBPHLV_PD");
                    }
                }
            }

            //一轴加载
            if (dicBrake["YZJZZDLV"] != Nothing || dicBrake["YZJZZDLV"] != Nothing)
            {
                dicTestItems["key2"] = new Tuple<string, string, string, string>("一轴加载制动率/不平衡率(%)",
                        dicBrake["YZJZZDLV"] + " / " + dicBrake["YZJZBPHLV"],
                        (dicBrake["YZJZZDLVBZ"] != Nothing ? MoreThan + dicBrake["YZJZZDLVBZ"] : dicBrake["YZJZZDLVBZ"]) + " / " + (dicBrake["YZJZBPHLVBZ"] != Nothing ? LessThan + dicBrake["YZBPHLVBZ"] : dicBrake["YZJZBPHLVBZ"]),
                        dicBrake["YZJZZDLV_PD"] + " / " + dicBrake["YZJZBPHLV_PD"]);


                if (dicBrake["YZJZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YZJZZDLV_PD"))
                    {
                        dicYQFailItems.Add("YZJZZDLV_PD", "一轴加载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YZJZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("YZJZZDLV_PD");
                    }
                }

                if (dicBrake["YZJZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YZJZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("YZJZBPHLV_PD", "一轴加载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YZJZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("YZJZBPHLV_PD");
                    }
                }
            }

            //二轴空载
            if (dicBrake["EZZDLV"] != Nothing || dicBrake["EZZDLV"] != Nothing)
            {
                dicTestItems["key3"] = new Tuple<string, string, string, string>("二轴空载制动率/不平衡率(%)",
                    dicBrake["EZZDLV"] + " / " + dicBrake["EZBPHLV"],
                    (dicBrake["EZZDLVBZ"] != Nothing ? MoreThan + dicBrake["EZZDLVBZ"] : dicBrake["EZZDLVBZ"]) + " / " + (dicBrake["EZBPHLVBZ"] != Nothing ? LessThan + dicBrake["EZBPHLVBZ"] : dicBrake["EZBPHLVBZ"]),
                    dicBrake["EZZDLV_PD"] + " / " + dicBrake["EZBPHLV_PD"]);

                if (dicBrake["EZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("EZZDLV_PD"))
                    {
                        dicYQFailItems.Add("EZZDLV_PD", "二轴空载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("EZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("EZZDLV_PD");
                    }
                }

                if (dicBrake["EZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("EZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("EZBPHLV_PD", "二轴空载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("EZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("EZBPHLV_PD");
                    }
                }
            }

            //二轴加载
            if (dicBrake["EZJZZDLV"] != Nothing || dicBrake["EZJZBPHLV"] != Nothing)
            {
                dicTestItems["key4"] = new Tuple<string, string, string, string>("二轴加载制动率/不平衡率(%)",
                    dicBrake["EZJZZDLV"] + " / " + dicBrake["EZJZBPHLV"],
                    (dicBrake["EZJZZDLVBZ"] != Nothing ? MoreThan + dicBrake["EZJZZDLVBZ"] : dicBrake["EZJZZDLVBZ"]) + " / " + (dicBrake["EZJZBPHLVBZ"] != Nothing ? LessThan + dicBrake["EZJZBPHLVBZ"] : dicBrake["EZJZBPHLVBZ"]),
                    dicBrake["EZJZZDLV_PD"] + " / " + dicBrake["EZJZBPHLV_PD"]);

                if (dicBrake["EZJZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("EZJZZDLV_PD"))
                    {
                        dicYQFailItems.Add("EZJZZDLV_PD", "二轴加载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("EZJZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("EZJZZDLV_PD");
                    }
                }

                if (dicBrake["EZJZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("EZJZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("EZJZBPHLV_PD", "二轴加载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("EZJZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("EZJZBPHLV_PD");
                    }
                }
            }

            //三轴空载
            if ((dicBrake["SZZDLV"] != Nothing || dicBrake["SZBPHLV"] != Nothing) && ZZS >= 3)
            {
                dicTestItems["key5"] = new Tuple<string, string, string, string>("三轴空载制动率/不平衡率(%)",
                    dicBrake["SZZDLV"] + " / " + dicBrake["SZBPHLV"],
                    (dicBrake["SZZDLVBZ"] != Nothing ? MoreThan + dicBrake["SZZDLVBZ"] : dicBrake["SZZDLVBZ"]) + " / " + (dicBrake["SZBPHLVBZ"] != Nothing ? LessThan + dicBrake["SZBPHLVBZ"] : dicBrake["SZBPHLVBZ"]),
                    dicBrake["SZZDLV_PD"] + " / " + dicBrake["SZBPHLV_PD"]);

                if (dicBrake["SZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SZZDLV_PD"))
                    {
                        dicYQFailItems.Add("SZZDLV_PD", "三轴空载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("SZZDLV_PD");
                    }
                }

                if (dicBrake["SZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("SZBPHLV_PD", "三轴空载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("SZBPHLV_PD");
                    }
                }
            }

            //三轴加载
            if ((dicBrake["SZJZZDLV"] != Nothing || dicBrake["SZJZBPHLV"] != Nothing) && ZZS >= 3)
            {
                dicTestItems["key6"] = new Tuple<string, string, string, string>("三轴加载制动率/不平衡率(%)",
                   dicBrake["SZJZZDLV"] + " / " + dicBrake["SZJZBPHLV"],
                   (dicBrake["SZJZZDLVBZ"] != Nothing ? MoreThan + dicBrake["SZJZZDLVBZ"] : dicBrake["SZJZZDLVBZ"]) + " / " + (dicBrake["SZJZBPHLVBZ"] != Nothing ? LessThan + dicBrake["SZJZBPHLVBZ"] : dicBrake["SZJZBPHLVBZ"]),
                   dicBrake["SZJZZDLV_PD"] + " / " + dicBrake["SZJZBPHLV_PD"]);

                if (dicBrake["SZJZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SZJZZDLV_PD"))
                    {
                        dicYQFailItems.Add("SZJZZDLV_PD", "三轴加载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SZJZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("SZJZZDLV_PD");
                    }
                }

                if (dicBrake["SZJZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SZJZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("SZJZBPHLV_PD", "三轴加载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SZJZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("SZJZBPHLV_PD");
                    }
                }
            }

            //四轴空载
            if ((dicBrake["SIZZDLV"] != Nothing || dicBrake["SIZBPHLV"] != Nothing) && ZZS >= 4)
            {
                dicTestItems["key7"] = new Tuple<string, string, string, string>("四轴空载制动率/不平衡率(%)",
                   dicBrake["SIZZDLV"] + " / " + dicBrake["SIZBPHLV"],
                   (dicBrake["SIZZDLVBZ"] != Nothing ? MoreThan + dicBrake["SIZZDLVBZ"] : dicBrake["SIZZDLVBZ"]) + " / " + (dicBrake["SIZBPHLVBZ"] != Nothing ? LessThan + dicBrake["SIZBPHLVBZ"] : dicBrake["SIZBPHLVBZ"]),
                   dicBrake["SIZZDLV_PD"] + " / " + dicBrake["SIZBPHLV_PD"]);

                if (dicBrake["SIZZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SIZZDLV_PD"))
                    {
                        dicYQFailItems.Add("SIZZDLV_PD", "四轴空载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SIZZDLV_PD"))
                    {
                        dicYQFailItems.Remove("SIZZDLV_PD");
                    }
                }

                if (dicBrake["SIZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SIZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("SIZBPHLV_PD", "四轴空载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SIZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("SIZBPHLV_PD");
                    }
                }
            }

            //五轴空载
            if ((dicBrake["WZZDLV"] != Nothing || dicBrake["WZBPHLV"] != Nothing) && ZZS >= 5)
            {
                dicTestItems["key8"] = new Tuple<string, string, string, string>("五轴空载制动率/不平衡率(%)",
                    dicBrake["WZZDLV"] + " / " + dicBrake["WZBPHLV"],
                    (dicBrake["WZZDLVBZ"] != Nothing ? MoreThan + dicBrake["WZZDLVBZ"] : dicBrake["WZZDLVBZ"]) + " / " + (dicBrake["WZBPHLVBZ"] != Nothing ? LessThan + dicBrake["WZBPHLVBZ"] : dicBrake["WZBPHLVBZ"]),
                    dicBrake["WZZDZ_PD"] + " / " + dicBrake["WZBPHLV_PD"]);

                if (dicBrake["WZZDZ_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("WZZDZ_PD"))
                    {
                        dicYQFailItems.Add("WZZDZ_PD", "五轴空载制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("WZZDZ_PD"))
                    {
                        dicYQFailItems.Remove("WZZDZ_PD");
                    }
                }

                if (dicBrake["WZBPHLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("WZBPHLV_PD"))
                    {
                        dicYQFailItems.Add("WZBPHLV_PD", "五轴空载不平衡率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("WZBPHLV_PD"))
                    {
                        dicYQFailItems.Remove("WZBPHLV_PD");
                    }
                }
            }

            //驻车和整车制动
            if ((dicBrake["ZCSZDLV"] != Nothing || dicBrake["ZCZDLV"] != Nothing))
            {
                dicTestItems["key9"] = new Tuple<string, string, string, string>("驻车制动率/整车制动率(%)",
                    dicBrake["ZCSZDLV"] + " / " + dicBrake["ZCZDLV"],
                   (dicBrake["SZDLVBZ"] != Nothing ? MoreThan + dicBrake["SZDLVBZ"] : dicBrake["SZDLVBZ"]) + " / " + (dicBrake["ZCZDLVBZ"] != Nothing ? MoreThan + dicBrake["ZCZDLVBZ"] : dicBrake["ZCZDLVBZ"]),
                    dicBrake["SZDLV_PD"] + " / " + dicBrake["ZCZDLV_PD"]);

                if (dicBrake["SZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("SZDLV_PD"))
                    {
                        dicYQFailItems.Add("SZDLV_PD", "驻车制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("SZDLV_PD"))
                    {
                        dicYQFailItems.Remove("SZDLV_PD");
                    }
                }

                if (dicBrake["ZCZDLV_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZCZDLV_PD"))
                    {
                        dicYQFailItems.Add("ZCZDLV_PD", "整车制动率");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZCZDLV_PD"))
                    {
                        dicYQFailItems.Remove("ZCZDLV_PD");
                    }
                }
            }

            if (IsQCLC && IsGC)
            {
                if ((dicBrake["ZCSZDLV"] != Nothing || dicBrake["ZCZDLV"] != Nothing))
                {
                    dicTestItems["key24"] = new Tuple<string, string, string, string>("汽车列车空载制动率",
                        dicBrake["QCLCZCZDLV"],
                        dicBrake["QCLCZCBZ"] != Nothing ? MoreThan + dicBrake["QCLCZCBZ"] : dicBrake["ZCZDLVBZ"], dicBrake["QCLCZC_PD"]);

                    if (dicBrake["QCLCZC_PD"] == FailC)
                    {
                        if (!dicYQFailItems.ContainsKey("QCLCZC_PD"))
                        {
                            dicYQFailItems.Add("QCLCZC_PD", "汽车列车空载制动率");
                        }
                    }
                    else
                    {
                        if (dicYQFailItems.ContainsKey("QCLCZC_PD"))
                        {
                            dicYQFailItems.Remove("QCLCZC_PD");
                        }
                    }
                }
            }
            
            #endregion

            #region 灯光部分
            RESULT_LAMP_BLL lamp_Bll = new RESULT_LAMP_BLL();
            Dictionary<string, string> dicLamp = new Dictionary<string, string>();
            //左外/内远光光强
            dicLamp.Add("ZWDYGGQ", Nothing);
            dicLamp.Add("ZWDYGGQ_PD", Nothing);
            dicLamp.Add("ZNDYGGQ", Nothing);
            dicLamp.Add("ZNDYGGQ_PD", Nothing);

            //右外/内远光光强
            dicLamp.Add("YWDYGGQ", Nothing);
            dicLamp.Add("YWDYGGQ_PD", Nothing);
            dicLamp.Add("YNDYGGQ", Nothing);
            dicLamp.Add("YNDYGGQ_PD", Nothing);

            //光强标准
            dicLamp.Add("DGGQXZ", Nothing);

            //左外灯远近光光强垂直偏移
            dicLamp.Add("ZWDYGCZPY", Nothing);
            dicLamp.Add("ZWDYGCZPY_PD", Nothing);
            dicLamp.Add("ZWDJGCZPY", Nothing);
            dicLamp.Add("ZWDJGCZPY_PD", Nothing);

            //左内灯远近光光强垂直偏移
            dicLamp.Add("ZNDYGCZPY", Nothing);
            dicLamp.Add("ZNDYGCZPY_PD", Nothing);
            dicLamp.Add("ZNDJGCZPY", Nothing);
            dicLamp.Add("ZNDJGCZPY_PD", Nothing);

            //右外灯远近光光强垂直偏移
            dicLamp.Add("YWDYGCZPY", Nothing);
            dicLamp.Add("YWDYGCZPY_PD", Nothing);
            dicLamp.Add("YWDJGCZPY", Nothing);
            dicLamp.Add("YWDJGCZPY_PD", Nothing);

            //右内灯远近光光强垂直偏移
            dicLamp.Add("YNDYGCZPY", Nothing);
            dicLamp.Add("YNDYGCZPY_PD", Nothing);
            dicLamp.Add("YNDJGCZPY", Nothing);
            dicLamp.Add("YNDJGCZPY_PD", Nothing);

            ////灯光总光强
            dicLamp.Add("DGZGQ", Nothing);
            dicLamp.Add("ZGQXZ", Nothing);
            dicLamp.Add("DGZGQ_PD", Nothing);

            dicLamp.Add("YGCZPYXZXX", Nothing);
            dicLamp.Add("YGCZPYXZSX", Nothing);
            dicLamp.Add("JGCZPYXZXX", Nothing);
            dicLamp.Add("JGCZPYXZSX", Nothing);

            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var lamp = lamp_Bll.GetModel(lstJCLSH[i]);

                if (!string.IsNullOrEmpty(lamp.DGGQXZ))
                {
                    dicLamp["DGGQXZ"] = lamp.DGGQXZ;
                }

                if (!string.IsNullOrEmpty(lamp.YGCZPYXZXX))
                {
                    dicLamp["YGCZPYXZXX"] = lamp.YGCZPYXZXX;
                }

                if (!string.IsNullOrEmpty(lamp.YGCZPYXZSX))
                {
                    dicLamp["YGCZPYXZSX"] = lamp.YGCZPYXZSX;
                }

                if (!string.IsNullOrEmpty(lamp.JGCZPYXZXX))
                {
                    dicLamp["JGCZPYXZXX"] = lamp.JGCZPYXZXX;
                }

                if (!string.IsNullOrEmpty(lamp.JGCZPYXZSX))
                {
                    dicLamp["JGCZPYXZSX"] = lamp.JGCZPYXZSX;
                }

                #region 左外/内远光光强
                //左外/内远光光强
                if (!string.IsNullOrEmpty(lamp.ZWDYGGQ_PD) && lamp.ZWDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZWDYGGQ_PD) > 0)
                    {
                        dicLamp["ZWDYGGQ"] = lamp.ZWDYGGQ;
                        dicLamp["ZWDYGGQ_PD"] = GetPDResult(lamp.ZWDYGGQ_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZNDYGGQ_PD) && lamp.ZNDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZNDYGGQ_PD) > 0)
                    {
                        dicLamp["ZNDYGGQ"] = lamp.ZNDYGGQ;
                        dicLamp["ZNDYGGQ_PD"] = GetPDResult(lamp.ZNDYGGQ_PD);
                    }
                }
                #endregion

                #region 右外/内远光光强
                //右外/内远光光强
                if (!string.IsNullOrEmpty(lamp.YWDYGGQ_PD) && lamp.YWDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YWDYGGQ_PD) > 0)
                    {
                        dicLamp["YWDYGGQ"] = lamp.YWDYGGQ;
                        dicLamp["YWDYGGQ_PD"] = GetPDResult(lamp.YWDYGGQ_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YNDYGGQ_PD) && lamp.YNDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YNDYGGQ_PD) > 0)
                    {
                        dicLamp["YNDYGGQ"] = lamp.YNDYGGQ;
                        dicLamp["YNDYGGQ_PD"] = GetPDResult(lamp.YNDYGGQ_PD);
                    }
                }
                #endregion

                #region 左外灯远近光光强垂直偏移
                //左外灯远近光光强垂直偏移
                if (!string.IsNullOrEmpty(lamp.ZWDYGCZPY_PD) && lamp.ZWDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZWDYGCZPY_PD) > 0)
                    {
                        dicLamp["ZWDYGCZPY"] = lamp.ZWDYGCZPY;
                        dicLamp["ZWDYGCZPY_PD"] = GetPDResult(lamp.ZWDYGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZWDJGCZPY_PD) && lamp.ZWDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZWDJGCZPY_PD) > 0)
                    {
                        dicLamp["ZWDJGCZPY"] = lamp.ZWDJGCZPY;
                        dicLamp["ZWDJGCZPY_PD"] = GetPDResult(lamp.ZWDJGCZPY_PD);
                    }
                }
                #endregion

                #region 左内灯远近光光强垂直偏移
                //左内灯远近光光强垂直偏移
                if (!string.IsNullOrEmpty(lamp.ZNDYGCZPY_PD) && lamp.ZNDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZNDYGCZPY_PD) > 0)
                    {
                        dicLamp["ZNDYGCZPY"] = lamp.ZNDYGCZPY;
                        dicLamp["ZNDYGCZPY_PD"] = GetPDResult(lamp.ZNDYGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZNDJGCZPY_PD) && lamp.ZNDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZNDJGCZPY_PD) > 0)
                    {
                        dicLamp["ZNDJGCZPY"] = lamp.ZNDJGCZPY;
                        dicLamp["ZNDJGCZPY_PD"] = GetPDResult(lamp.ZNDJGCZPY_PD);
                    }
                }
                #endregion

                #region 右外灯远近光光强垂直偏移
                //右外灯远近光光强垂直偏移
                if (!string.IsNullOrEmpty(lamp.YWDYGCZPY_PD) && lamp.YWDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YWDYGCZPY_PD) > 0)
                    {
                        dicLamp["YWDYGCZPY"] = lamp.YWDYGCZPY;
                        dicLamp["YWDYGCZPY_PD"] = GetPDResult(lamp.YWDYGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YWDJGCZPY_PD) && lamp.YWDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YWDJGCZPY_PD) > 0)
                    {
                        dicLamp["YWDJGCZPY"] = lamp.YWDJGCZPY;
                        dicLamp["YWDJGCZPY_PD"] = GetPDResult(lamp.YWDJGCZPY_PD);
                    }
                }
                #endregion

                #region 右内灯远近光光强垂直偏移
                //右内灯远近光光强垂直偏移
                if (!string.IsNullOrEmpty(lamp.YNDYGCZPY_PD) && lamp.YNDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YNDYGCZPY_PD) > 0)
                    {
                        dicLamp["YNDYGCZPY"] = lamp.YNDYGCZPY;
                        dicLamp["YNDYGCZPY_PD"] = GetPDResult(lamp.YNDYGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YNDJGCZPY_PD) && lamp.YNDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YNDJGCZPY_PD) > 0)
                    {
                        dicLamp["YNDJGCZPY"] = lamp.YNDJGCZPY;
                        dicLamp["YNDJGCZPY_PD"] = GetPDResult(lamp.YNDJGCZPY_PD);
                    }
                }
                #endregion

                #region 总发光强度
                //if (!string.IsNullOrEmpty(lamp.DGZGQ_PD) && lamp.DGZGQ_PD != Nothing)
                //{
                //    if (Convert.ToInt32(lamp.DGZGQ_PD) > 0)
                //    {
                //        dicLamp["DGZGQ"] = lamp.DGZGQ;
                //        dicLamp["ZGQXZ"] = lamp.ZGQXZ;
                //        dicLamp["DGZGQ_PD"] = GetPDResult(lamp.DGZGQ_PD);
                //    }
                //}
                #endregion
            }

            //左外/内远光发光强度
            if (dicLamp["ZWDYGGQ"] != Nothing || dicLamp["ZNDYGGQ"] != Nothing)
            {
                dicTestItems["key10"] = new Tuple<string, string, string, string>("前照灯左外/内灯远光发光强度(cd)",
                    dicLamp["ZWDYGGQ"] + " / " + dicLamp["ZNDYGGQ"],
                    MoreThan + dicLamp["DGGQXZ"],
                   dicLamp["ZWDYGGQ_PD"] + " / " + dicLamp["ZNDYGGQ_PD"]);

                if (dicLamp["ZWDYGGQ_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZWDYGGQ_PD"))
                    {
                        dicYQFailItems.Add("ZWDYGGQ_PD", "前照灯左外远光发光强度");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZWDYGGQ_PD"))
                    {
                        dicYQFailItems.Remove("ZWDYGGQ_PD");
                    }
                }

                if (dicLamp["ZNDYGGQ_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZNDYGGQ_PD"))
                    {
                        dicYQFailItems.Add("ZNDYGGQ_PD", "前照灯左内远光发光强度");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZNDYGGQ_PD"))
                    {
                        dicYQFailItems.Remove("ZNDYGGQ_PD");
                    }
                }
            }

            //右外/内远光发光强度
            if (dicLamp["YWDYGGQ"] != Nothing || dicLamp["YWDYGGQ"] != Nothing)
            {
                dicTestItems["key11"] = new Tuple<string, string, string, string>("前照灯右外/内灯远光发光强度(cd)",
                    dicLamp["YWDYGGQ"] + " / " + dicLamp["YNDYGGQ"],
                    MoreThan + dicLamp["DGGQXZ"],
                   dicLamp["YWDYGGQ_PD"] + " / " + dicLamp["YNDYGGQ_PD"]);

                if (dicLamp["YWDYGGQ_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YWDYGGQ_PD"))
                    {
                        dicYQFailItems.Add("YWDYGGQ_PD", "前照灯右外远光发光强度");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YWDYGGQ_PD"))
                    {
                        dicYQFailItems.Remove("YWDYGGQ_PD");
                    }
                }

                if (dicLamp["YNDYGGQ_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YNDYGGQ_PD"))
                    {
                        dicYQFailItems.Add("YNDYGGQ_PD", "前照灯右内远光发光强度");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YNDYGGQ_PD"))
                    {
                        dicYQFailItems.Remove("YNDYGGQ_PD");
                    }
                }
            }

            //左外灯远近光光强垂直偏移
            if (dicLamp["ZWDYGCZPY"] != Nothing || dicLamp["ZWDJGCZPY"] != Nothing)
            {
                dicTestItems["key12"] = new Tuple<string, string, string, string>("前照灯左外灯远/近光垂直偏移(H)",
                    dicLamp["ZWDYGCZPY"] + " / " + dicLamp["ZWDJGCZPY"],
                   (dicLamp["ZWDYGCZPY"] != Nothing ? dicLamp["YGCZPYXZXX"] + FromTo + dicLamp["YGCZPYXZSX"] : Nothing) + " / " + (dicLamp["ZWDJGCZPY"] != Nothing ? dicLamp["JGCZPYXZXX"] + FromTo + dicLamp["JGCZPYXZSX"] : Nothing),
                   dicLamp["ZWDYGCZPY_PD"] + " / " + dicLamp["ZWDJGCZPY_PD"]);

                if (dicLamp["ZWDYGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZWDYGCZPY_PD"))
                    {
                        dicYQFailItems.Add("ZWDYGCZPY_PD", "前照灯左外灯远光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZWDYGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("ZWDYGCZPY_PD");
                    }
                }

                if (dicLamp["ZWDJGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZWDJGCZPY_PD"))
                    {
                        dicYQFailItems.Add("ZWDJGCZPY_PD", "前照灯左外灯近光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZWDJGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("ZWDJGCZPY_PD");
                    }
                }
            }

            //左内灯远近光光强垂直偏移
            if (dicLamp["ZNDYGCZPY"] != Nothing || dicLamp["ZNDJGCZPY"] != Nothing)
            {
                dicTestItems["key13"] = new Tuple<string, string, string, string>("前照灯左内灯远/近光垂直偏移(H)",
                   dicLamp["ZNDYGCZPY"] + " / " + dicLamp["ZNDJGCZPY"],
                  (dicLamp["ZNDYGCZPY"] != Nothing ? dicLamp["YGCZPYXZXX"] + FromTo + dicLamp["YGCZPYXZSX"] : Nothing) + " / " + (dicLamp["ZNDJGCZPY"] != Nothing ? dicLamp["JGCZPYXZXX"] + FromTo + dicLamp["JGCZPYXZSX"] : Nothing),
                   dicLamp["ZNDYGCZPY_PD"] + " / " + dicLamp["ZNDJGCZPY_PD"]);

                if (dicLamp["ZNDYGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZNDYGCZPY_PD"))
                    {
                        dicYQFailItems.Add("ZNDYGCZPY_PD", "前照灯左内灯远光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZNDYGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("ZNDYGCZPY_PD");
                    }
                }

                if (dicLamp["ZNDJGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("ZNDJGCZPY_PD"))
                    {
                        dicYQFailItems.Add("ZNDJGCZPY_PD", "前照灯左内灯近光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("ZNDJGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("ZNDJGCZPY_PD");
                    }
                }
            }

            //右外灯远近光光强垂直偏移
            if (dicLamp["YWDYGCZPY"] != Nothing || dicLamp["YWDJGCZPY"] != Nothing)
            {
                dicTestItems["key14"] = new Tuple<string, string, string, string>("前照灯右外灯远/近光垂直偏移(H)",
                  dicLamp["YWDYGCZPY"] + " / " + dicLamp["YWDJGCZPY"],
                  (dicLamp["YWDYGCZPY"] != Nothing ? dicLamp["YGCZPYXZXX"] + FromTo + dicLamp["YGCZPYXZSX"] : Nothing) + " / " + (dicLamp["YWDJGCZPY"] != Nothing ? dicLamp["JGCZPYXZXX"] + FromTo + dicLamp["JGCZPYXZSX"] : Nothing),
                   dicLamp["YWDYGCZPY_PD"] + " / " + dicLamp["YWDJGCZPY_PD"]);

                if (dicLamp["YWDYGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YWDYGCZPY_PD"))
                    {
                        dicYQFailItems.Add("YWDYGCZPY_PD", "前照灯右外灯远光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YWDYGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("YWDYGCZPY_PD");
                    }
                }

                if (dicLamp["YWDJGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YWDJGCZPY_PD"))
                    {
                        dicYQFailItems.Add("YWDJGCZPY_PD", "前照灯右外灯近光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YWDJGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("YWDJGCZPY_PD");
                    }
                }
            }

            //右内灯远近光光强垂直偏移
            if (dicLamp["YNDYGCZPY"] != Nothing || dicLamp["YNDJGCZPY"] != Nothing)
            {
                dicTestItems["key15"] = new Tuple<string, string, string, string>("前照灯右内灯远/近光垂直偏移(H)",
                  dicLamp["YNDYGCZPY"] + " / " + dicLamp["YNDJGCZPY"],
                 (dicLamp["YNDYGCZPY"] != Nothing ? dicLamp["YGCZPYXZXX"] + FromTo + dicLamp["YGCZPYXZSX"] : Nothing) + " / " + (dicLamp["YNDJGCZPY"] != Nothing ? dicLamp["JGCZPYXZXX"] + FromTo + dicLamp["JGCZPYXZSX"] : Nothing),
                   dicLamp["YNDYGCZPY_PD"] + " / " + dicLamp["YNDJGCZPY_PD"]);

                if (dicLamp["YNDYGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YNDYGCZPY_PD"))
                    {
                        dicYQFailItems.Add("YNDYGCZPY_PD", "前照灯右内灯远光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YNDYGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("YNDYGCZPY_PD");
                    }
                }

                if (dicLamp["YNDJGCZPY_PD"] == FailC)
                {
                    if (!dicYQFailItems.ContainsKey("YNDJGCZPY_PD"))
                    {
                        dicYQFailItems.Add("YNDJGCZPY_PD", "前照灯右内灯近光垂直偏移");
                    }
                }
                else
                {
                    if (dicYQFailItems.ContainsKey("YNDJGCZPY_PD"))
                    {
                        dicYQFailItems.Remove("YNDJGCZPY_PD");
                    }
                }
            }

            //灯光总光强
            //if (dicLamp["DGZGQ"] != Nothing)
            //{
            //    lst_t_YQ.Add(new Tuple<string, string, string, string>("前照灯发光总强度(cd)",
            //        dicLamp["DGZGQ"],
            //        (dicLamp["ZGQXZ"] != Nothing ? LessThan + dicLamp["ZGQXZ"] : Nothing),
            //        dicLamp["DGZGQ_PD"]));
            //}
            #endregion

            #region 其他部分
            RESULT_SPEED_BLL speed_Bll = new RESULT_SPEED_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var speed = speed_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(speed.SD_PD))
                {
                    if (Convert.ToInt32(speed.SD_PD) > 0)
                    {
                        string strPD = GetPDResult(speed.SD_PD);
                        dicTestItems["key16"] = new Tuple<string, string, string, string>("车速表指示误差(km/h)",
                                 speed.SCSD,
                                 speed.SDBZXX + "～" + speed.SDBZSX,
                                 strPD);
                        if (strPD == FailC)
                        {
                            if (!dicYQFailItems.ContainsKey("CSBZSWC"))
                            {
                                dicYQFailItems.Add("CSBZSWC", "车速表指示误差");
                            }
                        }
                        else
                        {
                            if (dicYQFailItems.ContainsKey("CSBZSWC"))
                            {
                                dicYQFailItems.Remove("CSBZSWC");
                            }
                        }
                    }
                }
            }

            //侧滑
            RESULT_SIDESLIP_BLL sideSlip_Bll = new RESULT_SIDESLIP_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var sideSlip = sideSlip_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(sideSlip.QQCH_PD))
                {
                    if (Convert.ToInt32(sideSlip.QQCH_PD) > 0)
                    {
                        string strPD = GetPDResult(sideSlip.QQCH_PD);
                         dicTestItems["key17"] =new Tuple<string, string, string, string>("转向轮横向侧滑量(m/km)",
                                 sideSlip.QQCHSCZ,
                                 sideSlip.QQCHXZXX + "～" + sideSlip.QQCHXZSX,
                                 strPD);

                         if (strPD == FailC)
                         {
                             if (!dicYQFailItems.ContainsKey("ZXLHXCHL"))
                             {
                                 dicYQFailItems.Add("ZXLHXCHL", "转向轮横向侧滑量");
                             }
                         }
                         else
                         {
                             if (dicYQFailItems.ContainsKey("ZXLHXCHL"))
                             {
                                 dicYQFailItems.Remove("ZXLHXCHL");
                             }
                         }
                    }
                }
            }

            //路试
            RESULT_ROAD_BLL road_Bll = new RESULT_ROAD_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var road = road_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(road.LSZD_PD))
                {
                    if (Convert.ToInt32(road.LSZD_PD) > 0)
                    {
                        string strPD = GetPDResult(road.MFDD_PD);
                        dicTestItems["key18"] =new Tuple<string, string, string, string>("路试制动性能",
                                 road.MFDD,
                                 road.MFDDXZ,
                                 strPD);

                        if (strPD == FailC)
                        {
                            if (!dicYQFailItems.ContainsKey("LSZDXN"))
                            {
                                dicYQFailItems.Add("LSZDXN", "路试制动性能");
                            }
                        }
                        else
                        {
                            if (dicYQFailItems.ContainsKey("LSZDXN"))
                            {
                                dicYQFailItems.Remove("LSZDXN");
                            }
                        }
                    }
                }

                if (!string.IsNullOrEmpty(road.LSZDXTSJ_PD))
                {
                    if (Convert.ToInt32(road.LSZDXTSJ_PD) > 0)
                    {
                        string strPD = GetPDResult(road.LSZDXTSJ_PD);
                        dicTestItems["key19"] =new Tuple<string, string, string, string>("路试制动性能（T，稳定性）",
                                road.LSZDXTSJ,
                                 road.LSXTSJXZ,
                                 strPD);

                        if (strPD == FailC)
                        {
                            if (!dicYQFailItems.ContainsKey("LSZDXNTWDX"))
                            {
                                dicYQFailItems.Add("LSZDXNTWDX", "路试制动性能（T，稳定性）");
                            }
                        }
                        else
                        {
                            if (dicYQFailItems.ContainsKey("LSZDXNTWDX"))
                            {
                                dicYQFailItems.Remove("LSZDXNTWDX");
                            }
                        }
                    }
                }

                if (!string.IsNullOrEmpty(road.LSZC_PD))
                {
                    if (Convert.ToInt32(road.LSZC_PD) > 0)
                    {
                        string strPD = GetPDResult(road.LSZC_PD);
                        dicTestItems["key20"] =new Tuple<string, string, string, string>("坡道驻车",
                                 road.LSZDJLXZ,
                                 road.LSXTSJXZ,
                                 strPD);

                        if (strPD == FailC)
                        {
                            if (!dicYQFailItems.ContainsKey("PDZC"))
                            {
                                dicYQFailItems.Add("PDZC", "坡道驻车");
                            }
                        }
                        else
                        {
                            if (dicYQFailItems.ContainsKey("PDZC"))
                            {
                                dicYQFailItems.Remove("PDZC");
                            }
                        }
                    }
                }
            }

            if (bShowWKCCAndZBZL)
            {
                string strBZ = "±100或±2%";
                if (IsNewVehicle)
                {
                    strBZ = "±50或±1%";
                }

                //外廓尺寸
                RESULT_OVERALLSIZE_BLL overAllSize_BLL = new RESULT_OVERALLSIZE_BLL();
                for (int i = 0; i < lstJCLSH.Count; i++)
                {
                    var overAllSize = overAllSize_BLL.GetModel(lstJCLSH[i]);
                    if (!string.IsNullOrEmpty(overAllSize.ZCWKCC_PD))
                    {
                        if (Convert.ToInt32(overAllSize.ZCWKCC_PD) > 0)
                        {
                            string strPD = GetPDResult(overAllSize.ZCWKCC_PD);
                            dicTestItems["key21"] = new Tuple<string, string, string, string>("外廓尺寸",
                                     overAllSize.ZCSCWKCCCD + "×" + overAllSize.ZCSCWKCCKD + "×" + overAllSize.ZCSCWKCCGD,
                                     strBZ,
                                     strPD);

                            if (strPD == FailC)
                            {
                                if (!dicYQFailItems.ContainsKey("WKCC"))
                                {
                                    dicYQFailItems.Add("WKCC", "外廓尺寸");
                                }
                            }
                            else
                            {
                                if (dicYQFailItems.ContainsKey("WKCC"))
                                {
                                    dicYQFailItems.Remove("WKCC");
                                }
                            }
                        }
                    }
                }

                //整备质量
                RESULT_KERBMASS_BLL kerbMass_BLL = new RESULT_KERBMASS_BLL();
                for (int i = 0; i < lstJCLSH.Count; i++)
                {
                    var kerbMass = kerbMass_BLL.GetModel(lstJCLSH[i]);
                    if (!string.IsNullOrEmpty(kerbMass.ZBZL_PD))
                    {
                        if (Convert.ToInt32(kerbMass.ZBZL_PD) > 0)
                        {
                            string strPD = GetPDResult(kerbMass.ZBZL_PD);
                            dicTestItems["key22"] = new Tuple<string, string, string, string>("整备质量",
                                     kerbMass.SCZBZL,
                                     kerbMass.ZBZLXZXX + "或" + kerbMass.ZBZLXZSX,
                                     strPD);

                            if (strPD == FailC)
                            {
                                if (!dicYQFailItems.ContainsKey("WKCC"))
                                {
                                    dicYQFailItems.Add("ZBZL", "整备质量");
                                }
                            }
                            else
                            {
                                if (dicYQFailItems.ContainsKey("ZBZL"))
                                {
                                    dicYQFailItems.Remove("ZBZL");
                                }
                            }
                        }
                    }
                }
            }
            #endregion

            int iIndex = 1;
            for (int i = 1; i < 23; i++)
            {
                if (!string.IsNullOrEmpty(dicTestItems["key" + i].Item1))
                {
                    drYQ_Item["YQ_Seq_" + iIndex] = iIndex;
                    drYQ_Item["YQ_Item_" + iIndex] = dicTestItems["key" + i].Item1;
                    drYQ["Data_" + iIndex] = dicTestItems["key" + i].Item2;
                    drYQ["STD_" + iIndex] = dicTestItems["key" + i].Item3;
                    drYQ["PD_" + iIndex] = dicTestItems["key" + i].Item4;
                    iIndex++;
                }
            }

            dtYQ.Rows.Add(drYQ);
            dtYQ_Item.Rows.Add(drYQ_Item);

            lstDt.Add(dtYQ);
            lstDt.Add(dtYQ_Item);
            
            return lstDt;
        }

        /// <summary>
        /// 得到Report的数据源
        /// </summary>
        /// <returns></returns>
        public DataSet GetReportResource(DataSet ds)
        {
            DataTable dtBase = GetDataTableReport_Base(ds.Tables["dtBase"]);
            DataTable dtRG = GetDataTableReport_RG(ds.Tables["dtRG"]);

            List<DataTable> lstDataTable = GetDataTableReport_YQ(ds);

            string strJY_Mess = "您的爱车";
            var lstFailsKeys = dicYQFailItems.Keys.ToList();
            for (int i = 0; i < dicYQFailItems.Keys.Count; i++)
            {
                if (i != dicYQFailItems.Keys.Count - 1)
                {
                    strJY_Mess += dicYQFailItems[lstFailsKeys[i]] + "、";
                }
                else
                {
                    strJY_Mess += dicYQFailItems[lstFailsKeys[i]];
                }
            }

            if (dicYQFailItems.Keys.Count > 0)
            {
                strJY_Mess += "不合格，请及时调修后复检，消除安全隐患。";
            }
            else
            {
                strJY_Mess = "合格";
            }

            ds.Tables["dtBase"].Rows[0]["JY_Mess"] = strJY_Mess;
            ds.Tables["dtBase"].Rows[0]["JYJH"] = AJGetSuggestItems(JCLSH, IsSingle);

            return ds;
        }

        /// <summary>
        /// 得到建议部分内容
        /// </summary>
        /// <param name="JCLSH"></param>
        /// <param name="bSingle"></param>
        /// <returns></returns>
        private string AJGetSuggestItems(string JCLSH, bool bSingle)
        {
            string strRet = "";
            BGD_SUGGEST_BLL bll = new BGD_SUGGEST_BLL();
            var bgd = bll.GetModelList("JCLSH='" + JCLSH + "' and SingleFlag='" + bSingle + "'");
            if (bgd.Length == 0)
            {
                strRet = "";
            }
            else
            {
                if (!string.IsNullOrEmpty(bgd[0].SuggestItems))
                {
                    string strValues = bgd[0].SuggestItems;
                    CONST_DEFINE_WEB_BLL web_bll = new CONST_DEFINE_WEB_BLL();
                    strValues = strValues.Substring(0, strValues.Length - 1);
                    if (strValues.Contains(","))
                    {
                        string[] lst = strValues.Split(',');
                        foreach (var v in lst)
                        {
                            strRet += web_bll.GetModel(Convert.ToInt32(v)).Remark + "\r\n";
                        }
                    }
                    else
                    {
                        strRet += web_bll.GetModel(Convert.ToInt32(strValues)).Remark;
                    }
                }
            }

            return strRet;
        }

        /// <summary>
        /// 得到安检下次开始检测时间
        /// </summary>
        /// <param name="vInfo"></param>
        /// <returns></returns>
        private string[] AJGetStartEndTime(RESULT_VEHICLE_INFO vInfo)
        {
            string[] str = new string[2];
            bool bDX = vInfo.CLZLDH.Substring(0, 1) == "K" && (!IsXXKCAndWXKC);

            DateTime dtCCDJRQ = Convert.ToDateTime(vInfo.CCDJRQ);
            DateTime dtJCRQ = Convert.ToDateTime(vInfo.JCRQ);

            int iYear = Convert.ToDateTime(vInfo.JCRQ).Year;
            int iMonth = Convert.ToDateTime(vInfo.JCRQ).Month;

            if (dtCCDJRQ.Month <= iMonth)
            {
                iYear = iYear + 1;
            }

            if (IsYYC)
            {//营运车
                if (dtCCDJRQ.AddYears(5) > dtJCRQ)
                {//五年以内
                    str[0] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[1] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                    else
                    {
                        str[1] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                }
                else
                {
                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(4).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[0] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(4).ToString("MM月");
                    }
                    else
                    {
                        str[0] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(4).ToString("MM月");
                    }

                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(6).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[1] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(6).ToString("MM月");
                    }
                    else
                    {
                        str[1] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(6).ToString("MM月");
                    }
                }
            }
            else if (!IsYYC && (IsHC || bDX))
            {//非营运车并且是货车或者客车
                if (dtCCDJRQ.AddYears(10) > dtJCRQ)
                {
                    str[0] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[1] = (iYear +1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                    else
                    {
                        str[0] = (iYear +1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                        str[1] = (iYear +1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                }
                else
                {
                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(4).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[0] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(4).ToString("MM月");
                    }
                    else
                    {
                        str[0] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(4).ToString("MM月");
                    }

                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(6).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[1] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(6).ToString("MM月");
                    }
                    else
                    {
                        str[1] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(6).ToString("MM月");
                    }
                }
            }
            else if (IsXXKCAndWXKC)
            {
                if (dtCCDJRQ.AddYears(6) > dtJCRQ)
                {
                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[0] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                        str[1] = (iYear + 2).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                    else
                    {
                        str[0] = (iYear + 2).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                        str[1] = (iYear + 2).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                }
                else
                {
                    str[0] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                    if (Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).Month > Convert.ToDateTime(vInfo.CCDJRQ).Month)
                    {
                        str[1] = (iYear + 1).ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                    else
                    {
                        str[1] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
                    }
                }
            }
            else
            {
                if (iYear == dtJCRQ.Year)
                {
                    iYear = iYear + 1;
                }
                str[0] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).AddMonths(-2).ToString("MM月");
                str[1] = iYear.ToString() + "年" + Convert.ToDateTime(vInfo.CCDJRQ).ToString("MM月");
            }
            return str;
        }

        /// <summary>
        /// 得到安检国标
        /// </summary>
        /// <param name="vInfo"></param>
        /// <returns></returns>
        private string GetAJ_GB(RESULT_VEHICLE_INFO vInfo)
        {
            string strRet = "GB7258-2012、 GB21861-2014";

            //牵引车，作业车，货车
            if (IsQYC|| IsZYC || IsHC)
            {
                strRet += "、 GB23254-2009";
            }

            if (IsHC || IsGC)
            {
                strRet += "、 GB1589-2016";
            }

            DateTime dtCCRQ = Convert.ToDateTime(vInfo.CCRQ);

            if ((IsHC && dtCCRQ > Convert.ToDateTime("2012-09-01") && ZZL > 12000)
                || (IsGC && string.IsNullOrEmpty(vInfo.CSC) && Convert.ToInt32(vInfo.CSC) > 8000)
                || (IsZYC && dtCCRQ > Convert.ToDateTime("2014-01-01") && ZZL > 12000))
            {
                strRet += "、 GB25990-2010";
            }

            return strRet;
        }

        /// <summary>
        /// 得到是否测试人工
        /// </summary>
        /// <returns></returns>
        private bool GetIsTestRG()
        {
            bool b = false;
            RESULT_CHASISS_MANUAL_BLL manual_bll = new RESULT_CHASISS_MANUAL_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var manual = manual_bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(manual.JCLSH))
                {
                    b = true;
                    break;
                }
            }

            return b;
        }

        /// <summary>
        /// 得到不合格项目汇总
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        private string GetMSResult(string str)
        {
            string strValue = "";
            OUTLOOK_CHASISS_SUBITEM_BLL bll = new OUTLOOK_CHASISS_SUBITEM_BLL();
            if (!string.IsNullOrEmpty(str.Trim()))
            {
                if (str == Nothing)
                {
                    strValue = NothingC;
                }
                else
                {
                    strValue = str;
                }
            }
            else
            {
                strValue = Nothing;
            }
            return strValue;
        }

        /// <summary>
        /// 得到人工检验基本信息
        /// </summary>
        /// <param name="dtBase"></param>
        /// <returns></returns>
        public DataTable GetDataTableRG_Base(DataTable dtBase)
        {
            DataRow drBase = dtBase.NewRow();
            drBase["HPHM"] = Vehicle_Info.HPHM;
            drBase["CLZL"] = Vehicle_Info.CLZL;
            drBase["SYXZ"] = Vehicle_Info.SYXZ;
            drBase["LJXSLC"] = Vehicle_Info.LJXSLC;
            drBase["CCRQ"] = Convert.ToDateTime(Vehicle_Info.CCRQ).ToString("yyyy-MM-dd");
            drBase["CCDJRQ"] = Convert.ToDateTime(Vehicle_Info.CCDJRQ).ToString("yyyy-MM-dd");
            drBase["JCRQ"] = Convert.ToDateTime(Vehicle_Info.CLXXSJ).ToString("yyyy-MM-dd");
            drBase["LXDZ"] = Vehicle_Info.LXDZ;
            drBase["SYR"] = Vehicle_Info.SYR;
            drBase["LXDH"] = Vehicle_Info.LXDH;
            drBase["JCLSH"] = JCLSH;

            dtBase.Rows.Add(drBase);
            return dtBase;
        }

        /// <summary>
        /// 得到人工检验结果部分
        /// </summary>
        /// <param name="dtResult"></param>
        /// <returns></returns>
        public DataTable GetDataTableRG_Result(DataTable dtResult)
        {
            RESULT_CHASISS_MANUAL_BLL bll = new RESULT_CHASISS_MANUAL_BLL();
            DataRow drResult = dtResult.NewRow();
            drResult["JCLSH"] = JCLSH;
            drResult = SetDataTableDefaultValue(ref dtResult, Pass);
            if (bTestRG)
            {
                for (int i = 0; i < lstJCLSH.Count; i++)
                {
                    var manual = bll.GetModel(lstJCLSH[i]);
                    if (!string.IsNullOrEmpty(manual.RGJYBHGX))
                    {
                        string strRGJYBHGX = manual.RGJYBHGX.Substring(0, manual.RGJYBHGX.Length - 1);
                        if (strRGJYBHGX.IndexOf(',') > 0)
                        {
                            var items = strRGJYBHGX.Split(',');
                            foreach (var v in items)
                            {
                                var subItems = v.Split('-');
                                int iSub = Convert.ToInt32(subItems[0]);
                                drResult["PD_" + iSub] = Fail;
                            }
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(strRGJYBHGX))
                            {
                                var items = strRGJYBHGX.Split('-');
                                int iSub = Convert.ToInt32(items[0]);
                                drResult["PD_" + iSub] = Fail;
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(manual.DGJYBHGX))
                    {
                        string strDGJYBHGX = manual.DGJYBHGX.Substring(0, manual.DGJYBHGX.Length - 1);
                        if (strDGJYBHGX.IndexOf(',') > 0)
                        {
                            var items = strDGJYBHGX.Split(',');
                            foreach (var v in items)
                            {
                                var subItems = v.Split('-');
                                int iSub = Convert.ToInt32(subItems[0]);
                                drResult["PD_" + iSub] = Fail;
                            }
                        }
                        else
                        {
                            if (!string.IsNullOrEmpty(strDGJYBHGX))
                            {
                                var items = strDGJYBHGX.Split('-');
                                int iSub = Convert.ToInt32(items[0]);
                                drResult["PD_" + iSub] = Fail;
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(manual.LWCX_PD))
                    {
                        if (Convert.ToInt32(manual.LWCX_PD) > 0)
                        {
                            if (Convert.ToInt32(manual.LWCX_PD) == 1)
                            {
                                drResult["PD_LW"] = Pass;
                            }
                            else if (Convert.ToInt32(manual.LWCX_PD) == 2)
                            {
                                drResult["PD_LW"] = Fail;
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(manual.RGJYBJCX))
                    {
                        var items = manual.RGJYBJCX.Split(',');
                        for (int j = 0; j < items.Length; j++)
                        {
                            if (string.IsNullOrEmpty(items[j]) == false && items[j].Contains("-"))
                            {
                                var subItems = items[j].Split('-');
                                drResult["PD_" + subItems[0]] = Nothing;
                            }
                        }
                    }
                }
            }
            else
            {
                drResult = SetDataTableDefaultValue(ref dtResult, Nothing);
            }

            dtResult.Rows.Add(drResult);
            return dtResult;
        }

        /// <summary>
        /// 绑定安检人工部分
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        public DataSet BindReportResource_RG(DataSet ds)
        {
            DataTable dtBase = GetDataTableRG_Base(ds.Tables["dtBase"]);
            DataTable dtZD = GetDataTableRG_Result(ds.Tables["dtPD"]);

            return ds;
        }
        #endregion

        #region 三轮车摩托车
        /// <summary>
        /// 人工部分
        /// </summary>
        /// <param name="dtBase"></param>
        /// <returns></returns>
        public DataTable GetDataTableReportSLMT_Base(DataTable dtBase)
        {
            DataRow drBase = dtBase.NewRow();


            drBase["JCLSH"] = Vehicle_Info.JCLSH;
            drBase["YCY"] = Vehicle_Info.YCY;
            drBase["JYRQ"] = Convert.ToDateTime(Vehicle_Info.JCRQ).ToString("yyyy-MM-dd");
            drBase["JYLB"] = Vehicle_Info.JYLB;
            drBase["JYXM"] = AJGetJYXM(Vehicle_Info.JYXM);
            drBase["DLY"] = Vehicle_Info.DLY;
            drBase["JCXH"] = Vehicle_Info.JCXH;
            drBase["HPHM"] = Vehicle_Info.HPHM;
            drBase["SYR"] = Vehicle_Info.SYR;
            drBase["HPZL"] = Vehicle_Info.HPZL;
            drBase["CLLX"] = Vehicle_Info.CLZL;
            drBase["PPXH"] = Vehicle_Info.PPXH;
            drBase["VIN"] = Vehicle_Info.VIN;
            drBase["FDJH"] = Vehicle_Info.FDJH;
            drBase["RLLB"] = Vehicle_Info.RLLB;
            drBase["CCDJRQ"] = Vehicle_Info.CCDJRQ;
            drBase["CCRQ"] = Vehicle_Info.CCRQ;
            drBase["LCBDS"] = Vehicle_Info.LJXSLC;
            drBase["ZBZL"] = Vehicle_Info.ZBZL;
            drBase["QZDZ"] = Vehicle_Info.QZDZ;
            drBase["YGGSNFKT"] = Vehicle_Info.YGGSNFKT;
            drBase["ZJCS"] = Vehicle_Info.JCCS;
            dtBase.Rows.Add(drBase);
            return dtBase;
        }

        /// <summary>
        /// 制动
        /// </summary>
        /// <param name="dtZD"></param>
        /// <returns></returns>
        public DataTable GetDataTableReportSLMT_ZD(DataTable dtZD)
        {
            DataRow drZD = dtZD.NewRow();
            RESULT_BRAKE_BLL BRAKEbll = new RESULT_BRAKE_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var brakeM = BRAKEbll.GetModel(lstJCLSH[i]);

                if (!string.IsNullOrEmpty(brakeM.YZZLZ))
                {
                    drZD["QLZLH"] = brakeM.YZZLZ;
                }
                if (!string.IsNullOrEmpty(brakeM.YZYLZ))
                {
                    drZD["QLYLH"] = brakeM.YZYLZ;
                }
                if (!string.IsNullOrEmpty(brakeM.EZZLZ))
                {
                    drZD["HLZLH"] = brakeM.EZZLZ;
                }
                if (!string.IsNullOrEmpty(brakeM.EZYLZ))
                {
                    drZD["HLYLH"] = brakeM.EZYLZ;
                }
                if (!string.IsNullOrEmpty(brakeM.YZZZDZDL))
                {
                    drZD["QLZZDL"] = brakeM.YZZZDZDL;
                }
                if (!string.IsNullOrEmpty(brakeM.YZYZDZDL))
                {
                    drZD["QLYZDL"] = brakeM.YZYZDZDL;
                }
                if (!string.IsNullOrEmpty(brakeM.EZZZDZDL))
                {
                    drZD["HLZZDL"] = brakeM.EZZZDZDL;
                }
                if (!string.IsNullOrEmpty(brakeM.EZYZDZDL))
                {
                    drZD["HLYZDL"] = brakeM.EZYZDZDL;
                }
                if (!string.IsNullOrEmpty(brakeM.YZZDLV))
                {
                    drZD["QLZDLV"] = brakeM.YZZDLV;
                }
                if (!string.IsNullOrEmpty(brakeM.EZZDLV))
                {
                    drZD["HLZDLV"] = brakeM.EZZDLV;
                }
                if (!string.IsNullOrEmpty(brakeM.ZZSZDL))
                {
                    drZD["ZCZZDL"] = brakeM.ZZSZDL;
                }
                if (!string.IsNullOrEmpty(brakeM.ZYSZDL))
                {
                    drZD["ZCYZDL"] = brakeM.ZYSZDL;
                }
                if (!string.IsNullOrEmpty(brakeM.ZCSZDLV))
                {
                    drZD["ZCZDLV"] = brakeM.ZCSZDLV;
                }
                if (!string.IsNullOrEmpty(brakeM.ZDSZDJCCS))
                {
                    drZD["ZCDXCS"] = brakeM.ZDSZDJCCS;
                }
                if (!string.IsNullOrEmpty(brakeM.ZDYZJCCS))
                {
                    drZD["QLDXCS"] = brakeM.ZDYZJCCS;
                }
                if (!string.IsNullOrEmpty(brakeM.ZDEZJCCS))
                {
                    drZD["HLDXCS"] = brakeM.ZDEZJCCS;
                }
                if (!string.IsNullOrEmpty(brakeM.YZZDLV_PD))
                {
                    drZD["QL_PD"] = GetPDResult(brakeM.YZZDLV_PD);
                }
                if (!string.IsNullOrEmpty(brakeM.EZZDLV_PD))
                {
                    drZD["HL_PD"] = GetPDResult(brakeM.EZZDLV_PD);
                }
                if (!string.IsNullOrEmpty(brakeM.SZDLV_PD))
                {
                    drZD["ZC_PD"] =GetPDResult(brakeM.SZDLV_PD);
                }

            }
            dtZD.Rows.Add(drZD);
            return dtZD;
        }

        /// <summary>
        /// 灯光
        /// </summary>
        /// <param name="dtDG"></param>
        /// <returns></returns>
        public DataTable GetDataTableReportSLMT_DG(DataTable dtDG)
        {
            DataRow drDG = dtDG.NewRow();
            RESULT_LAMP_BLL LAMPbll = new RESULT_LAMP_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var lampM = LAMPbll.GetModel(lstJCLSH[i]);

                if (!string.IsNullOrEmpty(lampM.ZWDYGGQ))
                {
                    drDG["ZDYGFGQD"] = lampM.ZWDYGGQ;
                }
                if (!string.IsNullOrEmpty(lampM.YWDYGGQ))
                {
                    drDG["YDYGFGQD"] = lampM.YWDYGGQ;
                }

                if (!string.IsNullOrEmpty(lampM.ZWDYGGQ_PD))
                {
                    drDG["ZD_PD"] = GetPDResult(lampM.ZWDYGGQ_PD);
                }

                if (!string.IsNullOrEmpty(lampM.DGZWDJCCS))
                {
                  drDG["ZDDXCS"] = lampM.DGZWDJCCS;                
                }

                if (!string.IsNullOrEmpty(lampM.YWDYGGQ_PD))
                {
                   drDG["YD_PD"] = GetPDResult(lampM.YWDYGGQ_PD);
                }
                if (!string.IsNullOrEmpty(lampM.DGYWDJCCS))
                {
                    drDG["YDDXCS"] = lampM.DGYWDJCCS;
                     
                }
            }

            dtDG.Rows.Add(drDG);
            return dtDG;

        }

        /// <summary>
        /// 外廓尺寸
        /// </summary>
        /// <param name="dtWKCC"></param>
        /// <returns></returns>
        public DataTable GetDataTableReportSLMT_WKCC(DataTable dtWKCC)
        {
            DataRow drWKCC = dtWKCC.NewRow();
            RESULT_OVERALLSIZE_BLL overAllSize_Bll = new RESULT_OVERALLSIZE_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var wkccM = overAllSize_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(wkccM.ZCWKCC_PD)&&Convert.ToInt32(wkccM.ZCWKCC_PD) > 0)
                {
                   
                        drWKCC["ZCWKCC"] = wkccM.ZCSCWKCCCD + "×" + wkccM.ZCSCWKCCKD + "×" + wkccM.ZCSCWKCCGD;
                    
                }
                drWKCC["CLWKCC_PD"] = GetPDResult(wkccM.ZCWKCC_PD);
                drWKCC["CLWKCCDXCS"] = wkccM.WKCCJCCS;

            }
            dtWKCC.Rows.Add(drWKCC);
            return dtWKCC;

        }

        /// <summary>
        /// 路试性能
        /// </summary>
        /// <param name="dtLS"></param>
        /// <returns></returns>
        public DataTable GetDataTableReportSLMT_LS(DataTable dtLS)
        {
            DataRow drLS = dtLS.NewRow();
            RESULT_ROAD_BLL road_Bll = new RESULT_ROAD_BLL();
            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                var lsM = road_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(lsM.LSZD_PD) && Convert.ToInt32(lsM.LSZD_PD) > 0)
                {
                    string strLSZDXN = "";
                    if (!string.IsNullOrEmpty(lsM.LSZDJL))
                    {
                        strLSZDXN += string.Format("制动距离(m):{0},", lsM.LSZDJL);
                    }

                    if (!string.IsNullOrEmpty(lsM.MFDD))
                    {
                        strLSZDXN += string.Format("MFDD(米每秒二次方):{0},", lsM.MFDD);
                    }

                    if (!string.IsNullOrEmpty(lsM.LSZDXTSJ))
                    {
                        strLSZDXN += string.Format("协调时间(s):{0},", lsM.LSZDXTSJ);
                    }
                    if (!string.IsNullOrEmpty(lsM.LSZDPPQK))
                    {
                        if (Convert.ToInt32(lsM.LSZDPPQK) == 0)
                        {
                            strLSZDXN += string.Format("协调时间(s):{0},", lsM.LSZDXTSJ);
                        }
                        else
                        {
                            strLSZDXN += string.Format("协调时间(s):{0},", lsM.LSZDXTSJ);
                        }
                    }

                    int iPD = 20;
                    if (Convert.ToInt32(Vehicle_Info.ZZL) < Convert.ToInt32(Vehicle_Info.ZBZL) * 1.2)
                    {
                        iPD = 15;
                    }

                    strLSZDXN += string.Format("坡度驻车：在{0}%坡度上正反向停车保持5min固定不变。", iPD);

                    drLS["LSJYY"] = lsM.LSJYY;
                    drLS["LSZDXN"] = strLSZDXN;
                    drLS["LSZDXN_PD"] = GetPDResult(lsM.LSZD_PD);
                    drLS["LSZDXNDXCS"] = lsM.LSJCCS;
                }

            }
            dtLS.Rows.Add(drLS);
            return dtLS;

        }

        /// <summary>
        /// 绑定
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        public DataSet BindAJ_SLMT(DataSet ds)
        {
            DataTable dtBase = GetDataTableReportSLMT_Base(ds.Tables["JBXX"]);
            DataTable dtZD = GetDataTableReportSLMT_ZD(ds.Tables["JYJG"]);
            DataTable dtDG = GetDataTableReportSLMT_DG(ds.Tables["LAMP"]);
            DataTable dtLS = GetDataTableReportSLMT_LS(ds.Tables["ZDXN"]);
            DataTable dtWKCC = GetDataTableReportSLMT_LS(ds.Tables["WKCC"]);

            return ds;
        }

        #endregion

        #region 绑定人工检验仪器部分
        /// <summary>
        /// 绑定人工检验仪器部分
        /// </summary>
        /// <param name="ds"></param>
        /// <returns></returns>
        public DataSet BindReportSource_YQ(DataSet ds)
        {
            DataTable dtBase = GetDataTableYQ_Base(ds.Tables["dtBase"]);
            GetDataTableYQ_YQJY(ds);
            DataTable dtOthers = GetDataTableYQ_Others(ds.Tables["dtOthers"]);

            return ds;
        }

        /// <summary>
        /// 得到安检仪器的其他信息部分
        /// </summary>
        /// <param name="dataTable"></param>
        /// <returns></returns>
        private DataTable GetDataTableYQ_Others(DataTable dtOthers)
        {
            DataRow drOthers = SetDataTableDefaultValue(ref dtOthers, Nothing);

            for (int i = 0; i < lstJCLSH.Count; i++)
            {  //侧滑
                RESULT_SIDESLIP_BLL sideSlip_Bll = new RESULT_SIDESLIP_BLL();
                var sideSlip = sideSlip_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(sideSlip.QQCH_PD))
                {
                    if (Convert.ToInt32(sideSlip.QQCH_PD) > 0)
                    {
                        drOthers["QQCHSCZ"] = sideSlip.QQCHSCZ;

                        if (Vehicle_Info.ZXZLXDH == "2" || Vehicle_Info.ZXZXJXSDH == "0")
                        {
                            drOthers["QQCH_PD"] = Nothing;
                        }
                        else
                        {
                            drOthers["QQCH_PD"] = GetPDResult(sideSlip.QQCH_PD);
                        }
                        drOthers["CHJCCS"] = sideSlip.CHJCCS;
                    }
                }
                //车速表
                RESULT_SPEED_BLL speed_Bll = new RESULT_SPEED_BLL();
                var speed = speed_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(speed.SD_PD))
                {
                    if (Convert.ToInt32(speed.SD_PD) > 0)
                    {
                        drOthers["SCSD"] = speed.SCSD;
                        if (Vehicle_Info.JYLBDH == "01,")
                        {
                            drOthers["SD_PD"] = Nothing;
                        }
                        else
                        {
                            drOthers["SD_PD"] = GetPDResult(speed.SD_PD);
                        }
                        drOthers["SDJCCS"] = speed.SDJCCS;
                    }
                }

                RESULT_ROAD_BLL road_Bll = new RESULT_ROAD_BLL();
                var road = road_Bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(road.LSZD_PD))
                {
                    if (Convert.ToInt32(road.LSZD_PD) > 0)
                    {
                        string strLSZDXN = "";
                        if (!string.IsNullOrEmpty(road.LSZDJL))
                        {
                            strLSZDXN += string.Format("制动距离(m):{0},", road.LSZDJL);
                        }

                        if (!string.IsNullOrEmpty(road.MFDD))
                        {
                            strLSZDXN += string.Format("MFDD(米每秒二次方):{0},", road.MFDD);
                        }

                        if (!string.IsNullOrEmpty(road.LSZDXTSJ))
                        {
                            strLSZDXN += string.Format("协调时间(s):{0},", road.LSZDXTSJ);
                        }
                        if (!string.IsNullOrEmpty(road.LSZDPPQK))
                        {
                            if (Convert.ToInt32(road.LSZDPPQK) == 0)
                            {
                                strLSZDXN += string.Format("协调时间(s):{0},", road.LSZDXTSJ);
                            }
                            else
                            {
                                strLSZDXN += string.Format("协调时间(s):{0},", road.LSZDXTSJ);
                            }
                        }

                        int iPD = 20;
                        if (Convert.ToInt32(Vehicle_Info.ZZL) < Convert.ToInt32(Vehicle_Info.ZBZL) * 1.2)
                        {
                            iPD = 15;
                        }

                        strLSZDXN += string.Format("坡度驻车：在{0}%坡度上正反向停车保持5min固定不变。", iPD);

                        drOthers["LSJYY"] = road.LSJYY;
                        drOthers["LSZDXN"] = strLSZDXN;
                        drOthers["LSZD_PD"] = GetPDResult(road.LSZD_PD);
                        drOthers["LSJCCS"] = road.LSJCCS;
                    }
                }

                RESULT_OVERALLSIZE_BLL overAllSize_Bll = new RESULT_OVERALLSIZE_BLL();
                RESULT_VEHICLE_INFO_BLL vehicle_bll = new RESULT_VEHICLE_INFO_BLL();
                var overAllSize = overAllSize_Bll.GetModel(lstJCLSH[i]);
                var vehicle = vehicle_bll.GetModel(lstJCLSH[i]);
                if (!string.IsNullOrEmpty(overAllSize.ZCWKCC_PD))
                {
                    if (Convert.ToInt32(overAllSize.ZCWKCC_PD) > 0)
                    {
                        drOthers["ZCWKCC"] = overAllSize.ZCSCWKCCCD + "×" + overAllSize.ZCSCWKCCKD + "×" + overAllSize.ZCSCWKCCGD;
                    }
                    drOthers["ZCWKCC_PD"] = GetPDResult(overAllSize.ZCWKCC_PD);
                    drOthers["ZCWKCCDXCS"] = overAllSize.WKCCJCCS;
                }

                RESULT_KERBMASS_BLL kerbMass_Bll = new RESULT_KERBMASS_BLL();
                var kerbMass = kerbMass_Bll.GetModel(lstJCLSH[i]);

                if (!string.IsNullOrEmpty(kerbMass.ZBZL_PD))
                {
                    if (Convert.ToInt32(kerbMass.ZBZL_PD) > 0)
                    {
                        drOthers["SCZBZL"] = kerbMass.SCZBZL;
                        drOthers["ZBZL_PD"] = GetPDResult(kerbMass.ZBZL_PD);
                        drOthers["ZBZLJCCS"] = kerbMass.ZBZLJCCS;
                    }
                }

                drOthers["RESULT"] = "本报告单检验项目依据：" + GetAJ_GB(Vehicle_Info) + "检验标准及检验方法";
                drOthers["JCLSH"] = lstJCLSH[i];

                if (IsQCLC && IsGC)
                {
                    RESULT_VEHICLE_INFO_BLL vBll = new RESULT_VEHICLE_INFO_BLL();
                    RESULT_BRAKE_BLL bBll = new RESULT_BRAKE_BLL();
                    var vInfo = vBll.GetModel(lstJCLSH[i]);
                    var vZCInfo = bBll.GetModel(vInfo.GLCJCLSH);

                    if (string.IsNullOrEmpty(vZCInfo.ZCZDLV_PD) == false && Convert.ToInt32(vZCInfo.ZCZDLV_PD) > 0)
                    {
                        drOthers["ZCZDResult"] = GetPDResult(vZCInfo.ZCZDLV_PD);
                    }
                    else
                    {
                        drOthers["ZCZDResult"] = Nothing;
                    }
                    drOthers["Remark"] = YQRemark;
                }
                else
                {
                    drOthers["ZCZDResult"] = Nothing;
                    drOthers["Remark"] = Empty;
                }
            }

            dtOthers.Rows.Add(drOthers);
            return dtOthers;
        }

        /// <summary>
        /// 得到安检仪器基础信息部分
        /// </summary>
        /// <param name="dataTable"></param>
        /// <returns></returns>
        public DataTable GetDataTableYQ_Base(DataTable dataTable)
        {
            DataRow drBase = dataTable.NewRow();
            if (string.IsNullOrEmpty(Vehicle_Info.GLCJCLSH.ToString()) == false && IsQCLC)
            {
                YQRemark = "主车号牌:" + Vehicle_Info.GLCHPHM;
            }

            drBase["AJLSH"] = Vehicle_Info.JCLSH.Split('-')[0];
            drBase["YCY"] = Vehicle_Info.YCY;
            drBase["JCRQ"] = Convert.ToDateTime(Vehicle_Info.JCRQ).ToString("yyyy-MM-dd");
            drBase["JYLB"] = Vehicle_Info.JYLB;
            drBase["JYXM"] = AJGetJYXM(Vehicle_Info.JYXM);
            drBase["DLY"] = Vehicle_Info.DLY;
            drBase["HPHM"] = Vehicle_Info.HPHM;
            drBase["SYR"] = Vehicle_Info.SYR;
            drBase["HPZL"] = Vehicle_Info.HPZL;
            drBase["CLZL"] = Vehicle_Info.CLZL;
            drBase["PP"] = Vehicle_Info.PP;
            drBase["XH"] = Vehicle_Info.XH;
            drBase["VIN"] = Vehicle_Info.VIN;
            drBase["FDJH"] = Vehicle_Info.FDJH;
            drBase["CCDJRQ"] = Convert.ToDateTime(Vehicle_Info.CCDJRQ).ToString("yyyy-MM-dd");
            drBase["CCRQ"] = Convert.ToDateTime(Vehicle_Info.CCRQ).ToString("yyyy-MM-dd");
            drBase["RLLB"] = Vehicle_Info.RLLB;
            drBase["QDXS"] = Vehicle_Info.QDXS;
            drBase["ZCZWZ"] = Vehicle_Info.ZCZWZ;
            drBase["ZXZXJXS"] = Vehicle_Info.ZXZXJXS;
            drBase["ZBZL"] = Vehicle_Info.ZBZL;
            drBase["QZDZ"] = Vehicle_Info.QZDZ;
            drBase["YGGSNFKT"] = Vehicle_Info.YGGSNFKT;
            drBase["JCCS"] = Vehicle_Info.JCCS;
            drBase["JCLSH"] = JCLSH;
            drBase["JCXH"] = Vehicle_Info.JCXH;
            dataTable.Rows.Add(drBase);
            return dataTable;
        }

        /// <summary>
        /// 得到安检仪器检验部分
        /// </summary>
        /// <param name="ds"></param>
        public void GetDataTableYQ_YQJY(DataSet ds)
        {
            DataTable dtYZ = ds.Tables["dtYZ"];
            DataTable dtEZ = ds.Tables["dtEZ"];
            DataTable dtSZ = ds.Tables["dtSZ"];
            DataTable dtSIZ = ds.Tables["dtSIZ"];
            DataTable dtWZ = ds.Tables["dtWZ"];
            DataTable dtBrake = ds.Tables["dtBrake"];
            DataTable dtLampZW = ds.Tables["dtLampZW"];
            DataTable dtLampZN = ds.Tables["dtLampZN"];
            DataTable dtLampYW = ds.Tables["dtLampYW"];
            DataTable dtLampYN = ds.Tables["dtLampYN"];

            DataRow drYZ = SetDataTableDefaultValue(ref dtYZ, Nothing);
            DataRow drEZ = SetDataTableDefaultValue(ref dtEZ, Nothing);
            DataRow drSZ = SetDataTableDefaultValue(ref dtSZ, Nothing);
            DataRow drSIZ = SetDataTableDefaultValue(ref dtSIZ, Nothing);
            DataRow drWZ = SetDataTableDefaultValue(ref dtWZ, Nothing);
            DataRow drBrake = SetDataTableDefaultValue(ref dtBrake, Nothing);
            DataRow drLampZW = SetDataTableDefaultValue(ref dtLampZW, Nothing);
            DataRow drLampZN = SetDataTableDefaultValue(ref dtLampZN, Nothing);
            DataRow drLampYW = SetDataTableDefaultValue(ref dtLampYW, Nothing);
            DataRow drLampYN = SetDataTableDefaultValue(ref dtLampYN, Nothing);

            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                RESULT_BRAKE_BLL brake_bll = new RESULT_BRAKE_BLL();
                var brake = brake_bll.GetModel(lstJCLSH[i]);

                if (string.IsNullOrEmpty(brake.JCLSH))
                {
                    continue;
                }

                #region 一轴
                if (!string.IsNullOrEmpty(brake.FHTYZZLZ))
                {
                    drYZ["YZZLZ"] = brake.FHTYZZLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.YZZLZ))
                    {
                        drYZ["YZZLZ"] = brake.YZZLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.FHTYZYLZ))
                {
                    drYZ["YZYLZ"] = brake.FHTYZYLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.YZYLZ))
                    {
                        drYZ["YZYLZ"] = brake.YZYLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.YZZZDZDL))
                {
                    drYZ["YZZZDZDL"] = brake.YZZZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.YZYZDZDL))
                {
                    drYZ["YZYZDZDL"] = brake.YZYZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.YZZZDCZD))
                {
                    drYZ["YZZZDCZD"] = brake.YZZZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.YZYZDCZD))
                {
                    drYZ["YZYZDCZD"] = brake.YZYZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.YZZDLV_PD))
                {
                    drYZ["YZZDLV_PD"] = GetPDResult(brake.YZZDLV_PD);
                    drYZ["YZZDLV"] = brake.YZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.YZBPHLV_PD))
                {
                    drYZ["YZBPHLV_PD"] = GetPDResult(brake.YZBPHLV_PD);
                    drYZ["YZBPHLV"] = brake.YZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.YZSZDL))
                {
                    drYZ["YZSZDL"] = brake.YZSZDL;
                }

                if (!string.IsNullOrEmpty(brake.YZJZZZ))
                {
                    drYZ["YZJZZZ"] = brake.YZJZZZ;
                }

                if (!string.IsNullOrEmpty(brake.YZJZZDLV_PD))
                {
                    drYZ["YZJZZDLV_PD"] = GetPDResult(brake.YZJZZDLV_PD);
                    drYZ["YZJZZDLV"] = brake.YZJZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.YZJZBPHLV_PD))
                {
                    drYZ["YZJZBPHLV_PD"] = GetPDResult(brake.YZJZBPHLV_PD);
                    drYZ["YZJZBPHLV"] = brake.YZJZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.ZDYZJCCS))
                {
                    drYZ["ZDYZJCCS"] = brake.ZDYZJCCS;
                }
                #endregion

                #region 二轴
                if (!string.IsNullOrEmpty(brake.FHTEZZLZ))
                {
                    drEZ["EZZLZ"] = brake.FHTEZZLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.EZZLZ))
                    {
                        drEZ["EZZLZ"] = brake.EZZLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.FHTEZYLZ))
                {
                    drEZ["EZYLZ"] = brake.FHTEZYLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.EZYLZ))
                    {
                        drEZ["EZYLZ"] = brake.EZYLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.EZZZDZDL))
                {
                    drEZ["EZZZDZDL"] = brake.EZZZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.EZYZDZDL))
                {
                    drEZ["EZYZDZDL"] = brake.EZYZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.EZZZDCZD))
                {
                    drEZ["EZZZDCZD"] = brake.EZZZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.EZYZDCZD))
                {
                    drEZ["EZYZDCZD"] = brake.EZYZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.EZZDLV_PD))
                {
                    drEZ["EZZDLV_PD"] = GetPDResult(brake.EZZDLV_PD);
                    drEZ["EZZDLV"] = brake.EZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.EZBPHLV_PD))
                {
                    drEZ["EZBPHLV_PD"] = GetPDResult(brake.EZBPHLV_PD);
                    drEZ["EZBPHLV"] = brake.EZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.EZSZDL))
                {
                    drEZ["EZSZDL"] = brake.EZSZDL;
                }

                if (!string.IsNullOrEmpty(brake.EZJZZZ))
                {
                    drEZ["EZJZZZ"] = brake.EZJZZZ;
                }

                if (!string.IsNullOrEmpty(brake.EZJZZDLV_PD))
                {
                    drEZ["EZJZZDLV_PD"] = GetPDResult(brake.EZJZZDLV_PD);
                    drEZ["EZJZZDLV"] = brake.EZJZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.EZJZBPHLV_PD))
                {
                    drEZ["EZJZBPHLV_PD"] = GetPDResult(brake.EZJZBPHLV_PD);
                    drEZ["EZJZBPHLV"] = brake.EZJZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.ZDEZJCCS))
                {
                    drEZ["ZDEZJCCS"] = brake.ZDEZJCCS;
                }
                #endregion

                #region 三轴
                if (!string.IsNullOrEmpty(brake.FHTSZZLZ))
                {
                    drSZ["SZZLZ"] = brake.FHTSZZLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.SZZLZ))
                    {
                        drSZ["SZZLZ"] = brake.SZZLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.FHTSZYLZ))
                {
                    drSZ["SZYLZ"] = brake.FHTSZYLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.SZYLZ))
                    {
                        drSZ["SZYLZ"] = brake.SZYLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.SZZZDZDL))
                {
                    drSZ["SZZZDZDL"] = brake.SZZZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.SZYZDZDL))
                {
                    drSZ["SZYZDZDL"] = brake.SZYZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.SZZZDCZD))
                {
                    drSZ["SZZZDCZD"] = brake.SZZZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.SZYZDCZD))
                {
                    drSZ["SZYZDCZD"] = brake.SZYZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.SZZDLV_PD))
                {
                    drSZ["SZZDLV_PD"] = GetPDResult(brake.SZZDLV_PD);
                    drSZ["SZZDLV"] = brake.SZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.SZBPHLV_PD))
                {
                    drSZ["SZBPHLV_PD"] = GetPDResult(brake.SZBPHLV_PD);
                    drSZ["SZBPHLV"] = brake.SZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.SZSZDL))
                {
                    drSZ["SZSZDL"] = brake.SZSZDL;
                }

                if (!string.IsNullOrEmpty(brake.SZJZZZ))
                {
                    drSZ["SZJZZZ"] = brake.SZJZZZ;
                }

                if (!string.IsNullOrEmpty(brake.SZJZZDLV_PD))
                {
                    drSZ["SZJZZDLV_PD"] = GetPDResult(brake.SZJZZDLV_PD);
                    drSZ["SZJZZDLV"] = brake.SZJZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.SZJZBPHLV_PD))
                {
                    drSZ["SZJZBPHLV_PD"] = GetPDResult(brake.SZJZBPHLV_PD);
                    drSZ["SZJZBPHLV"] = brake.SZJZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.ZDSZJCCS))
                {
                    drSZ["ZDSZJCCS"] = brake.ZDSZJCCS;
                }
                #endregion

                #region 四轴
                if (!string.IsNullOrEmpty(brake.FHTSIZZLZ))
                {
                    drSIZ["SIZZLZ"] = brake.FHTSIZZLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.SIZZLZ))
                    {
                        drSIZ["SIZZLZ"] = brake.SIZZLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.FHTSIZYLZ))
                {
                    drSIZ["SIZYLZ"] = brake.FHTSIZYLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.SIZYLZ))
                    {
                        drSIZ["SIZYLZ"] = brake.SIZYLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.SIZZZDZDL))
                {
                    drSIZ["SIZZZDZDL"] = brake.SIZZZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.SIZYZDZDL))
                {
                    drSIZ["SIZYZDZDL"] = brake.SIZYZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.SIZZZDCZD))
                {
                    drSIZ["SIZZZDCZD"] = brake.SIZZZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.SIZYZDCZD))
                {
                    drSIZ["SIZYZDCZD"] = brake.SIZYZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.SIZZDLV_PD))
                {
                    drSIZ["SIZZDLV_PD"] = GetPDResult(brake.SIZZDLV_PD);
                    drSIZ["SIZZDLV"] = brake.SIZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.SIZBPHLV_PD))
                {
                    drSIZ["SIZBPHLV_PD"] = GetPDResult(brake.SIZBPHLV_PD);
                    drSIZ["SIZBPHLV"] = brake.SIZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.SIZSZDL))
                {
                    drSIZ["SIZSZDL"] = brake.SIZSZDL;
                }

                if (!string.IsNullOrEmpty(brake.SIZJZZZ))
                {
                    drSIZ["SIZJZZZ"] = brake.SIZJZZZ;
                }

                if (!string.IsNullOrEmpty(brake.SIZJZZDLV_PD))
                {
                    drSIZ["SIZJZZDLV_PD"] = GetPDResult(brake.SIZJZZDLV_PD);
                    drSIZ["SIZJZZDLV"] = brake.SIZJZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.SIZJZBPHLV_PD))
                {
                    drSIZ["SIZJZBPHLV_PD"] = GetPDResult(brake.SIZJZBPHLV_PD);
                    drSIZ["SIZJZBPHLV"] = brake.SIZJZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.ZDSIZJCCS))
                {
                    drSIZ["ZDSIZJCCS"] = brake.ZDSIZJCCS;
                }
                #endregion

                #region 五轴
                if (!string.IsNullOrEmpty(brake.FHTWZZLZ))
                {
                    drWZ["WZZLZ"] = brake.FHTWZZLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.WZZLZ))
                    {
                        drWZ["WZZLZ"] = brake.WZZLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.FHTWZYLZ))
                {
                    drWZ["WZYLZ"] = brake.FHTWZYLZ;
                }
                else
                {
                    if (!string.IsNullOrEmpty(brake.WZYLZ))
                    {
                        drWZ["WZYLZ"] = brake.WZYLZ;
                    }
                }

                if (!string.IsNullOrEmpty(brake.WZZZDZDL))
                {
                    drWZ["WZZZDZDL"] = brake.WZZZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.WZYZDZDL))
                {
                    drWZ["WZYZDZDL"] = brake.WZYZDZDL;
                }

                if (!string.IsNullOrEmpty(brake.WZZZDCZD))
                {
                    drWZ["WZZZDCZD"] = brake.WZZZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.WZYZDCZD))
                {
                    drWZ["WZYZDCZD"] = brake.WZYZDCZD;
                }

                if (!string.IsNullOrEmpty(brake.WZZDLV_PD))
                {
                    drWZ["WZZDLV_PD"] = GetPDResult(brake.WZZDLV_PD);
                    drWZ["WZZDLV"] = brake.WZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.WZBPHLV_PD))
                {
                    drWZ["WZBPHLV_PD"] = GetPDResult(brake.WZBPHLV_PD);
                    drWZ["WZBPHLV"] = brake.WZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.WZSZDL))
                {
                    drWZ["WZSZDL"] = brake.WZSZDL;
                }

                if (!string.IsNullOrEmpty(brake.WZJZZZ))
                {
                    drWZ["WZJZZZ"] = brake.WZJZZZ;
                }

                if (!string.IsNullOrEmpty(brake.WZJZZDLV_PD))
                {
                    drWZ["WZJZZDLV_PD"] = GetPDResult(brake.WZJZZDLV_PD);
                    drWZ["WZJZZDLV"] = brake.WZJZZDLV;
                }

                if (!string.IsNullOrEmpty(brake.WZJZBPHLV_PD))
                {
                    drWZ["WZJZBPHLV_PD"] = GetPDResult(brake.WZJZBPHLV_PD);
                    drWZ["WZJZBPHLV"] = brake.WZJZBPHLV;
                }

                if (!string.IsNullOrEmpty(brake.ZDWZJCCS))
                {
                    drWZ["ZDWZJCCS"] = brake.ZDWZJCCS;
                }
                #endregion

                #region 整车
                if (!string.IsNullOrEmpty(brake.ZCZDLV_PD))
                {
                    drBrake["ZCZDLV_PD"] = GetPDResult(brake.ZCZDLV_PD);
                    drBrake["ZCZDLV"] = brake.ZCZDLV;
                }
                if (!string.IsNullOrEmpty(brake.ZCZZ))
                {
                    drBrake["ZCZZ"] = brake.ZCZZ;
                }
                if (!string.IsNullOrEmpty(brake.ZCZDL))
                {
                    drBrake["ZCZDL"] = brake.ZCZDL;
                }
                if (!string.IsNullOrEmpty(brake.ZDZCJCCS))
                {
                    drBrake["ZDZCJCCS"] = brake.ZDZCJCCS;
                }
                if (!string.IsNullOrEmpty(brake.SZDLV_PD))
                {
                    drBrake["SZDLV_PD"] = GetPDResult(brake.SZDLV_PD);
                    drBrake["ZSZDL"] = brake.ZSZDL;
                    drBrake["ZCSZDLV"] = brake.ZCSZDLV;
                }

                if (!string.IsNullOrEmpty(brake.ZDSZDJCCS))
                {
                    drBrake["ZDSZDJCCS"] = brake.ZDSZDJCCS;
                }

                if (!string.IsNullOrEmpty(brake.YZZDTLH))
                {
                    drBrake["YZZDTLH"] = brake.YZZDTLH;
                }

                if (!string.IsNullOrEmpty(brake.YZYDTLH))
                {
                    drBrake["YZYDTLH"] = brake.YZYDTLH;
                }

                if (!string.IsNullOrEmpty(brake.EZZDTLH))
                {
                    drBrake["EZZDTLH"] = brake.EZZDTLH;
                }

                if (!string.IsNullOrEmpty(brake.EZYDTLH))
                {
                    drBrake["EZYDTLH"] = brake.EZYDTLH;
                }

                if (string.IsNullOrEmpty(brake.QCLCZC_PD) == false && Convert.ToInt32(brake.QCLCZC_PD) > 0)
                {
                    YQRemark += "                汽车列车整车制动率：" + brake.QCLCZCZDLV;
                }
                #endregion
            }

            for (int i = 0; i < lstJCLSH.Count; i++)
            {
                RESULT_LAMP_BLL lamp_bll = new RESULT_LAMP_BLL();
                var lamp = lamp_bll.GetModel(lstJCLSH[i]);
                if (string.IsNullOrEmpty(lamp.JCLSH))
                {
                    continue;
                }

                #region 大灯
                //左外
                if (!string.IsNullOrEmpty(lamp.ZWDYGGQ_PD) && lamp.ZWDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZWDYGGQ_PD) > 0)
                    {
                        drLampZW["ZWDYGGQ"] = lamp.ZWDYGGQ;
                        drLampZW["ZWDYGGQ_PD"] = GetPDResult(lamp.ZWDYGGQ_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZWDYGCZPY_PD) && lamp.ZWDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZWDYGCZPY_PD) > 0)
                    {
                        drLampZW["ZWDYGCZPYL"] = lamp.ZWDYGCZPYL;
                        drLampZW["ZWDYGCZPY"] = lamp.ZWDYGCZPY;
                        drLampZW["ZWDYGCZPY_PD"] = GetPDResult(lamp.ZWDYGCZPY_PD);
                    }
                }


                if (!string.IsNullOrEmpty(lamp.ZWDJGCZPY_PD) && lamp.ZWDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZWDJGCZPY_PD) > 0)
                    {
                        drLampZW["ZWDJGCZPYL"] = lamp.ZWDJGCZPYL;
                        drLampZW["ZWDJGCZPY"] = lamp.ZWDJGCZPY;
                        drLampZW["ZWDJGCZPY_PD"] = GetPDResult(lamp.ZWDJGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZWDYGDG))
                {
                    drLampZW["ZWDYGDG"] = lamp.ZWDYGDG;
                }

                if (!string.IsNullOrEmpty(lamp.ZWDJGDG))
                {
                    drLampZW["ZWDJGDG"] = lamp.ZWDJGDG;
                }

                if (!string.IsNullOrEmpty(lamp.DGZWDJCCS))
                {
                    drLampZW["DGZWDJCCS"] = lamp.DGZWDJCCS;
                }

                //左内
                if (!string.IsNullOrEmpty(lamp.ZNDYGGQ_PD) && lamp.ZNDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZNDYGGQ_PD) > 0)
                    {
                        drLampZN["ZNDYGGQ"] = lamp.ZNDYGGQ;
                        drLampZN["ZNDYGGQ_PD"] = GetPDResult(lamp.ZNDYGGQ_PD);

                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZNDYGCZPY_PD) && lamp.ZNDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZNDYGCZPY_PD) > 0)
                    {
                        drLampZN["ZNDYGCZPYL"] = lamp.ZWDYGCZPYL;
                        drLampZN["ZNDYGCZPY"] = lamp.ZWDYGCZPY;
                        drLampZN["ZNDYGCZPY_PD"] = GetPDResult(lamp.ZWDYGCZPY_PD);
                    }
                }


                if (!string.IsNullOrEmpty(lamp.ZNDJGCZPY_PD) && lamp.ZNDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.ZNDJGCZPY_PD) > 0)
                    {
                        drLampZN["ZNDJGCZPYL"] = lamp.ZNDJGCZPYL;
                        drLampZN["ZNDJGCZPY"] = lamp.ZNDJGCZPY;
                        drLampZN["ZNDJGCZPY_PD"] = GetPDResult(lamp.ZNDJGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.ZNDYGDG))
                {
                    drLampZN["ZNDYGDG"] = lamp.ZNDYGDG;
                }

                if (!string.IsNullOrEmpty(lamp.ZNDJGDG))
                {
                    drLampZN["ZNDJGDG"] = lamp.ZNDJGDG;
                }

                if (!string.IsNullOrEmpty(lamp.DGZNDJCCS))
                {
                    drLampZN["DGZNDJCCS"] = lamp.DGZNDJCCS;
                }

                //右外
                if (!string.IsNullOrEmpty(lamp.YWDYGGQ_PD) && lamp.YWDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YWDYGGQ_PD) > 0)
                    {
                        drLampYW["YWDYGGQ"] = lamp.YWDYGGQ;
                        drLampYW["YWDYGGQ_PD"] = GetPDResult(lamp.YWDYGGQ_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YWDYGCZPY_PD) && lamp.YWDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YWDYGCZPY_PD) > 0)
                    {
                        drLampYW["YWDYGCZPYL"] = lamp.YWDYGCZPYL;
                        drLampYW["YWDYGCZPY"] = lamp.YWDYGCZPY;
                        drLampYW["YWDYGCZPY_PD"] = GetPDResult(lamp.YWDYGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YWDJGCZPY_PD) && lamp.YWDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YWDJGCZPY_PD) > 0)
                    {
                        drLampYW["YWDJGCZPYL"] = lamp.YWDJGCZPYL;
                        drLampYW["YWDJGCZPY"] = lamp.YWDJGCZPY;
                        drLampYW["YWDJGCZPY_PD"] = GetPDResult(lamp.YWDJGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YWDYGDG))
                {
                    drLampYW["YWDYGDG"] = lamp.YWDYGDG;
                }

                if (!string.IsNullOrEmpty(lamp.YWDJGDG))
                {
                    drLampYW["YWDJGDG"] = lamp.YWDJGDG;
                }

                if (!string.IsNullOrEmpty(lamp.DGYWDJCCS))
                {
                    drLampYW["DGYWDJCCS"] = lamp.DGYWDJCCS;
                }

                //右内
                if (!string.IsNullOrEmpty(lamp.YNDYGGQ_PD) && lamp.YNDYGGQ_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YNDYGGQ_PD) > 0)
                    {
                        drLampYN["YNDYGGQ"] = lamp.YNDYGGQ;
                        drLampYN["YNDYGGQ_PD"] = GetPDResult(lamp.YNDYGGQ_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YNDYGCZPY_PD) && lamp.YNDYGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YNDYGCZPY_PD) > 0)
                    {
                        drLampYN["YNDYGCZPYL"] = lamp.YNDYGCZPYL;
                        drLampYN["YNDYGCZPY"] = lamp.YNDYGCZPY;
                        drLampYN["YNDYGCZPY_PD"] = GetPDResult(lamp.YNDYGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YNDJGCZPY_PD) && lamp.YNDJGCZPY_PD != Nothing)
                {
                    if (Convert.ToInt32(lamp.YNDJGCZPY_PD) > 0)
                    {
                        drLampYN["YNDJGCZPYL"] = lamp.YNDJGCZPYL;
                        drLampYN["YNDJGCZPY"] = lamp.YNDJGCZPY;
                        drLampYN["YNDJGCZPY_PD"] = GetPDResult(lamp.YNDJGCZPY_PD);
                    }
                }

                if (!string.IsNullOrEmpty(lamp.YNDYGDG))
                {
                    drLampYN["YNDYGDG"] = lamp.YNDYGDG;
                }

                if (!string.IsNullOrEmpty(lamp.YNDJGDG))
                {
                    drLampYN["YNDJGDG"] = lamp.YNDJGDG;
                }

                if (!string.IsNullOrEmpty(lamp.DGYNDJCCS))
                {
                    drLampYN["DGYNDJCCS"] = lamp.DGYNDJCCS;
                }
                #endregion
            }

            dtYZ.Rows.Add(drYZ);
            dtEZ.Rows.Add(drEZ);
            dtSZ.Rows.Add(drSZ);
            dtSIZ.Rows.Add(drSIZ);
            dtWZ.Rows.Add(drWZ);
            dtBrake.Rows.Add(drBrake);
            dtLampZW.Rows.Add(drLampZW);
            dtLampZN.Rows.Add(drLampZN);
            dtLampYW.Rows.Add(drLampYW);
            dtLampYN.Rows.Add(drLampYN);
        }
        #endregion
    }
}
